You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
istrasci
changed the title
Documentation for magic-state-checking names
Documentation for magic-state-checking methods
Jan 12, 2024
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: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 calledstarted?
. 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.
The text was updated successfully, but these errors were encountered: