-
Notifications
You must be signed in to change notification settings - Fork 82
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
get value for state name? #27
Comments
@arches can you give me a better description? Also, unless this is related to the activerecord integration, this might be better asked in the parent project, https://github.com/state-machines/state_machines/issues In the parent project readme, it shows (and I use it this way): vehicle.state # => "parked"
vehicle.state_name # => :parked |
My setup: class Vehicle
state_machine :state do
state :parked, value: 0
end
end My goal is to turn Vehicle.state_value(:parked) # => 0 (Sorry to ask in the wrong place, I got here from pluginaweek/state_machine#343) |
ok, thanks @rosskevin! moved to state-machines/state_machines#22 |
I have a bunch of states defined with custom values. How can I retrieve the value for a given state? Thanks!
The text was updated successfully, but these errors were encountered: