State Machine v0.4.0 Release Notes

Release Date: 2008-12-14 // over 15 years ago
    • โœ‚ Remove the PluginAWeek namespace
    • โž• Add generic attribute predicate (e.g. "#{attribute}?(state_name)") and state predicates (e.g. "#{state}?")
    • โž• Add Sequel support
    • ๐Ÿ›  Fix aliasing :initialize on ActiveRecord models causing warnings when the environment is reloaded
    • ๐Ÿ›  Fix ActiveRecord state machines trying to query the database on unmigrated models
    • ๐Ÿ›  Fix initial states not getting set when the current value is an empty string [Aaron Gibralter]
    • โž• Add rake tasks for generating graphviz files for state machines [Nate Murray]
    • ๐Ÿ›  Fix initial state not being included in list of known states
    • โž• Add other_states directive for defining additional states not referenced in transitions or callbacks [Pete Forde]
    • Add next_#{event}_transition for getting the next transition that would be performed if the event were invoked
    • โž• Add the ability to override the pluralized name of an attribute for creating scopes
    • โž• Add the ability to halt callback chains by: throw :halt
    • โž• Add support for dynamic to states in transitions (e.g. :to => lambda {Time.now})
    • Add support for using real blocks in before_transition/after_transition calls instead of using the :do option
    • โž• Add DataMapper support
    • Include states referenced in transition callbacks in the list of a machine's known states
    • Only generate the known states for a machine on demand, rather than calculating beforehand
    • โž• Add the ability to skip state change actions during a transition (e.g. vehicle.ignite(false))
    • โž• Add the ability for the state change action (e.g. save for ActiveRecord) to be configurable
    • Allow state machines to be defined on any Ruby class, not just ActiveRecord (removes all external dependencies)
    • ๐Ÿ”จ Refactor transitions, guards, and callbacks for better organization/design
    • ๐Ÿ‘‰ Use a class containing the transition context in callbacks, rather than an ordered list of each individual attribute
    • Add without_#{attribute} named scopes (opposite of the existing with_#{attribute} named scopes) [Sean O'Brien]