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
In my model I had
include ActiveRecord::Transitions
state_machine do
state :submitted
state :valid
state :hidden
state :banned
end
And kept getting wrong number of arguments (1 for 0) until I renamed :valid to :validated . That closed an issue although word 'valid' isn't one of Ruby or Rails reserved words. There are many word exceptions for SQL databases but is that related to the particular field's value?
The text was updated successfully, but these errors were encountered:
You should avoid using the same names in your state machine that AR implements as methods in your model. If you create state "valid", few additional methods will be created in your model (e.g. "valid?"), which will most probably break validations in your model. It's not a bug of Transitions.
In my model I had
include ActiveRecord::Transitions
state_machine do
state :submitted
state :valid
state :hidden
state :banned
end
And kept getting
wrong number of arguments (1 for 0)
until I renamed:valid
to:validated
. That closed an issue although word 'valid' isn't one of Ruby or Rails reserved words. There are many word exceptions for SQL databases but is that related to the particular field's value?The text was updated successfully, but these errors were encountered: