Created
April 26, 2010 06:12
-
-
Save tekwiz/379033 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
state_machine User do | |
state :new | |
state :normal | |
state :locked | |
end | |
state_machine Membership do | |
state :new | |
state :active | |
state :inactive | |
end | |
state_machine Account, User do | |
# interesting idea... thoughts on this? | |
end |
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 User | |
state_machine do | |
state :new | |
state :normal | |
state :locked | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This circles around the same problem domain and comes up with a different solution from a different approach: http://www.infoq.com/news/2009/11/restfulie-hypermedia-services
The states are kept in the model, but now we're linking it to the controller and adding some actions via hyperlinking into the resources directly.