Created
July 12, 2010 22:05
-
-
Save jasondew/473149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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