aasm_column
has been removed. Useaasm.attribute_name
insteadaasm_human_event_name
has been removed. Useaasm.human_event_name
instead
- bugfix: initialize the aasm state column after initialization of the ActiveRecord instance (see issue #191 for details)
- bugfix: avoid Rails autoloading conflicts (see issue #137 and issue #139 for details)
- bugfix: fire guards only once per transition, part 2 (see issue #187 for details)
aasm_column
is deprecated. Useaasm.attribute_name
instead
- bugfix: really support block-guards (defined within a transition block) (see issue #186 for details)
- fire guards only once per transition (see issue #184 for details)
aasm_human_event_name
is deprecated, useaasm.human_event_name
instead
- support
if
andunless
guard syntax: (see issue #179 and issue #181), thanks to @bigtunacan - may configure to not allow direct assignment for persisted AASM models (see issue #53)
- DSL change: callbacks don't require
to_state
parameter anymore, but still support it (closing issues #11, #58 and #80 thanks to @ejlangev) - DSL change:
after_commit
hooks are now event-based (see issue #112) - DSL change: event and state callbacks have been re-ordered; state callbacks are not run anymore if any guard fails
- DSL change:
:on_transition
renamed to:after
- DSL change:
:on_transition
renamed to:after
- DSL change: transition
:after
binding changed (see issue #59, thanks to @stiff) - DSL change: instance-based events inspection now returns event instances (instead of the event names as symbol)
- DSL change: instance-based permissible_events has been removed in favor or events(:permissible => true)
- DSL change: class-based events now returns a list of Event instances (instead of a hash with event names as keys)
- DSL change: renamed permissible states and events to permitted states events
- removed deprecated methods (mostly the ones prefixed with
aasm_
)
- allow retrieving the current event (
aasm.current_event
) (see issue #159 and issue #168)
- bugfix: support reloading development environment in Rails (see issue #148)
- bugfix: avoid conflicts with
failed
andfired
event names (see issue #157), thanks to @MichaelXavier - bugfix: not using transactions unless saving to the database (see issue #162 and issue #164), thanks to @roberthoner
- bugfix:
after_commit
should only run if saving to the database (see issue #151), thanks to @ivantsepp
- bugfix: permissible events will respect given
guards
(see issue #150)
- support for Rails 4.1 enum fields (see issue #124, thanks to @bkon)
- bugfix: allow lazy-evaluation for Rails 3 scopes (see issue #144, thanks to @laurens)
- bugfix: permissible_events and events did not contain events with an empty "from" transition (see issue #140 and issue #141, thanks to @daniel-rikowski)
- support Sequel (see issue #119, thanks to @godfat)
- may not fire an unknown event (see issue #128
- bugfix: don't require ActiveRecord for localizing AASM event and state name (see issue #113, thanks to @silentshade)
- validating the current state (see issue #95, thanks to @ivantsepp)
- allow configuring behavior of nested transactions (see issue #107)
- support multiple guards per transition
- support event guards (see issue #85)
- support reading from- and to-state during on_transition callback (see issue #100)
- support state.human_name (aliased to state.localized_name) (see issue #105)
- initialize the state even if validation is skipped (for ActiveRecord and Mongoid persistence) (see issue #103, thanks to @vfonic and @aaronklaassen)
- added support for event blocks (thanks to @Intrepidd)
- added support for
after_commit
callback (transaction support) (thanks to @tisba)
- fixed issue 88: wrong number of arguments for transaction method
- support nested ActiveRecord transactions (@ozeias)
- allow overwriting of events, can be very useful with inheritance (@Intrepidd)
- added configuration option to disable automatic scope creation
- fixed deprecation warning with Rails 4 (
Relation#update_all
with conditions is deprecated) - fixing issue #69 ( ActiveRecord scopes are not chainable)
- fixing issue #66 (state methods not reflecting the current state)
- supporting instance level inspection for states (including permissible state, see issue #54)
- added autocreation of constants for each state (@jherdman)
- added autocreation of state scopes for Mongoid (thanks to @jonnyshields)
- added support for localized state names (on a class level, like
Record.aasm.states.map(&:localized_name)
)
- supporting event inspection for to-states transitions (
Event#transitions_to_state?
)
- supporting ActiveRecord transactions when firing an event
aasm_from_states_for_state
now supports to filter for specific transition
- added class method
aasm_from_states_for_state
to retrieve all from states (regarding transitions) for a given state
- added support for transitions from all other states (thanks to @swrobel)
- guard checks (e.g.
may_edit?
) now support guard parameters as well
- fixed issue with generating docs using yard
- removed deprecation warning when localizing aasm state names (look at issue #38 for details)
- bugfix: if configured to skip validation the code does not validate anymore
- bugfix: get rid of error with old rubygems versions
- bugfix: Subclasses of aasm-enabled classes don't lose settings anymore (thanks to codez)
- bugfix: ActiveRecord scopes are generated when using the new DSL
- ActiveRecord persistence can ignore validation when trying to save invalid models
- added support for Mongoid (Thanks, Michał Taberski)
- switched documentation to the new DSL
- whiny transactions: by default, raise an exception if an event transition is not possible
- you may disable whiny transactions
- supporting new DSL (which is much shorter)
- bugfix: avoid naming conflict with i18n
- supporting i18n
- supporting regular expressions for hash values and strings