Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for magic-state-checking methods #238

Open
istrasci opened this issue Jan 12, 2024 · 0 comments
Open

Documentation for magic-state-checking methods #238

istrasci opened this issue Jan 12, 2024 · 0 comments

Comments

@istrasci
Copy link

It seems that you can check if the object object/workflow is in a particular state by calling a magic state_name? method. Unless I'm missing something, all I see in the documentation regarding these magic methods is the following in the README:

Let’s create an article instance and check in which state it is:

article = Article.new
article.accepted? # => false
article.new? # => true

I was unaware of this functionality, and it recently got me into trouble in my app. I had defined a :started state, but also created my own method called started?. Only after debugging incorrect behaviour did I figure out my own method was not being called.

It would be nice if the documentation described this behaviour and explained it more clearly/explicitly.

@istrasci istrasci changed the title Documentation for magic-state-checking names Documentation for magic-state-checking methods Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant