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
# Sets the initial state of the machine. This can be either the static name# of a state or a lambda block which determines the initial state at# creation time.definitial_state=(new_initial_state)@initial_state=new_initial_stateadd_states([@initial_state])unlessdynamic_initial_state?# Update all states to reflect the new initial statestates.each{|state| state.initial=(state.name == @initial_state)}# Output a warning if there are conflicting initial states for the machine's# attributeifowner_class_has_initial_state?warn("Both #{owner_class.name} and its #{name.inspect} machine have defined "\
"a default for \"#{attribute}\". Use only one or the other for defining "\
"defaults to avoid unexpected behaviors.")endend
this shows the warning even if the initial value set in the model is the same as in the machine (in my case ActiveRecord).
The database design is quite strict, so I can not remove the default, but would anyway like to have the default in the code, to make the code more readable. How about checking the values against the defaults? If the default is the same, then do not show the message.
Thanks
The text was updated successfully, but these errors were encountered:
this shows the warning even if the initial value set in the model is the same as in the machine (in my case ActiveRecord).
The database design is quite strict, so I can not remove the default, but would anyway like to have the default in the code, to make the code more readable. How about checking the values against the defaults? If the default is the same, then do not show the message.
Thanks
The text was updated successfully, but these errors were encountered: