Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class MyControllerOrPlainRubyObject
extend CodedOptions
coded_options :state, %w(initial active closed)
STATES = %w(initial active closed)
STATE_OPTIONS = [["initial", 0],
["active", 1],
["closed", 2]]
def state
return unless state_id
STATES[state_id]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.