Commit Graph

6 Commits

Author SHA1 Message Date
Tim Pope d59dbbf6b0 Allow duplicate state names in subclasses
When an AASM including class is subclassed, a shallow copy is made of
the StateMachine object.  This means that all subclasses share the same
states hash and thus the same set of states, which prevents (among other
things) different subclasses from using the same state names.

Give StateMachine a smart #clone method that copies the states hash and
invoke that rather than #dup upon subclassing.
2008-11-05 11:06:36 -05:00
Scott Barron 3d69497ee3 Take state column for AR persistance out of class variables and add them to the
StateMachine object.
2008-06-22 11:17:12 -04:00
Scott Barron 08d129c46d nix the StateMachineFactory hash, keep it all in StateMachine 2008-06-01 14:12:57 -07:00
Scott Barron bafbe77fb5 SM support events
instance methods consistently use self.class.aasm_ rather than going through SMFactory
2008-05-31 15:37:22 -07:00
Scott Barron cf2bd90cfb StateMachine supports adding State 2008-05-31 15:33:17 -07:00
Scott Barron 7dbbc1480b Add StateMachine object and StateMachineFactory
Supports initial state in SM
2008-05-31 15:27:15 -07:00