Created
January 14, 2011 21:37
-
-
Save knewter/780296 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Make a module that, when extended on an ActiveRecord class, will do the following: | |
# 1) Get the array Klass.state_machines.keys # => [:state] | |
# 2) states.each {|state| "def #{state}; blah; end; def #{state}=; blah; end" } | |
# NOTE: the code above should modify the getters and setters to actually look at the StateMachineState polymorphic table, write there and read there. | |
# 3) Take care of named scopes as well, because those will be broken. | |
# 4) Other, unknown yet still broken stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment