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]