pluginaweek / state_machine

Adds support for creating state machines for attributes on any Ruby class

This URL has Read+Write access

state_machine / CHANGELOG.rdoc
100644 76 lines (61 sloc) 3.62 kb

master

  • Allow creating transitions with no from state (effectively allowing the transition for any from state)
  • Reduce the number of objects created for each transition

0.2.0 / 2008-06-29

  • Add a non-bang version of events (e.g. park) that will return a boolean value for success
  • Raise an exception if the bang version of events are used (e.g. park!) and no transition is successful
  • Change callbacks to act a little more like ActiveRecord
  • Avoid using string evaluation for dynamic methods

0.1.1 / 2008-06-22

  • Remove log files from gems

0.1.0 / 2008-05-05

  • Completely rewritten from scratch
  • Renamed to state_machine
  • Removed database dependencies
  • Removed models in favor of an attribute-agnostic design
  • Use ActiveSupport::Callbacks instead of eval_call
  • Remove dry_transaction_rollbacks dependencies
  • Added functional tests
  • Updated documentation

0.0.1 / 2007-09-26

  • Add dependency on custom_callbacks
  • Move test fixtures out of the test application root directory
  • Improve documentation
  • Remove the StateExtension module in favor of adding singleton methods to the stateful class
  • Convert dos newlines to unix newlines
  • Fix error message when a given event can’t be found in the database
  • Add before_#{action} and #{action} callbacks when an event is performed
  • All state and event callbacks can now explicitly return false in order to cancel the action
  • Refactor ActiveState callback creation
  • Refactor unit tests so that they use mock classes instead of themselves
  • Allow force_reload option to be set in the state association
  • Don’t save the entire model when updating the state_id
  • Raise exception if a class tries to define a state more than once
  • Add tests for PluginAWeek::Has::States::ActiveState
  • Refactor active state/active event creation
  • Fix owner_type not being set correctly in active states/events of subclasses
  • Allow subclasses to override the initial state
  • Fix problem with migrations using default null when column cannot be null
  • Moved deadline support into a separate plugin (has_state_deadlines).
  • Added many more unit tests.
  • Simplified many of the interfaces for maintainability.
  • Added support for turning off recording state changes.
  • Removed the short_description and long_description columns, in favor of an optional human_name column.
  • Fixed not overriding the correct equality methods in the StateTransition class.
  • Added to_sym to State and Event.
  • State#name and Event#name now return the string version of the name instead of the symbol version.
  • Added State#human_name and Event#human_name to automatically figure out what the human name is if it isn’t specified in the table.
  • Updated manual rollbacks to use the new Rails edge api (ActiveRecord::Rollback exception).
  • Moved StateExtension class into a separate file in order to help keep the has_state files clean.
  • Renamed InvalidState and InvalidEvent exceptions to StateNotFound and EventNotFound in order to follow the ActiveRecord convention (i.e. RecordNotFound).
  • Added StateNotActive and EventNotActive exceptions to help differentiate between states which don’t exist and states which weren’t defined in the class.
  • Added support for defining callbacks like so:

    def before_exit_parked end

    def after_enter_idling end

  • Added support for defining callbacks using class methods:

    before_exit_parked :fasten_seatbelt

  • Added event callbacks after the transition has occurred (e.g. after_park)
  • State callbacks no longer receive any of the arguments that were provided in the event action
  • Updated license to include our names.