- Fix ClassInvoker instantiating class twice, thanks to danielnolan
- Replace File.exists? with File.exist?, thanks to kyoshidajp
- Shrink gem size and export only needed files to work #742, thanks to brunoarueira
- Lock redis-objects to 1.6.0 as 1.7.0 has breaking changes #796
-
Fix fire! with string argument #787, in PR#788 thanks to norman
-
Allow
fire
andfire!
to accept a String or Symbol for the event name, and raise AASM::UndefinedEvent rather than AASM::UndefinedState when an event can not be found, thanks to norman.
- Add Ruby 3.1 and Rails 7 to the CI matrix #775, thanks to petergoldstein
- Fixed an error in Ruby 3 when specifying a method that takes keyword arguments, such as event's before hook #777, thanks to pocari
- Fix multi-threading bug not firing success callbacks #778, thanks to guewen
- Raise AASM::UndefinedState when calling fire or fire! with undefined event names #753, thanks to danielvdao
- Fixing Readme typos #745 #772 #774 #781, thanks to jaredsmithse jcat4 ChandanChainani TessHuelskamp
- Add github actions config #750, thanks to aka47
- Test against for Rails 6.0 and improve ci #719, thanks to yujideveloper
- Fix migration class name to work with zeitwerk #720, thanks to rwegrzyniak
- fix: timestamp will work with named machine #739, thanks to RolandStuder
- Create namespaced scopes in PR #735, thanks to caiohsramos
- Fix multiple state machines example per class on README in PR #732, thanks to RodrigoVitiello
- Update version in recommendation to add after_commit_everywhere in PR #729, thanks to Envek
- Fix i18n Event translations failing #721 in PR #723, thanks to the-spectator
- Add documentation to the Readme about how parameters are handled in AASM events in PR #722, thanks to dstuebe
- Fix human_state cached across locales #709 in PR 716, thanks to the-spectator
- Relocate DslHelper from root namespace to under AASM namespace in PR #711 thank to yujideveloper
- Document how to define transitions from any state in in PR #699 thanks to hedgesky
- Add simple option for auto-generated timestamps in PR #677, thanks to jaynetics
- Fix Depreciation message for after_commit_everywhere #695 in PR #696
- Fix human_state to use display option #684 in PR #697
- Remove support for ruby 2.3
- Fix after_commit in nested transactions #536 without explicit AR dependency in PR #668, thanks to stokarenko
- Remove support for Rails 3.2
- Revert Fix for :after_commit within nested transaction because it adds after_commit_action dependency which is dependent on many gems.
- Fix :after_commit within nested transaction #666, thanks to stokarenko
- Add permitted_transitions to group permitted event with state #664, thanks to dnamsons
- Add Ruby 2.7.0 & 2.6.5 to Travis CI Test Matrix #661, thanks to the-spectator
- Handle InvalidTransition in transition_from matcher #653, thanks to ryanwood
- Fix no_direct_assignment, couldn't be turned off pragmatically #636
- Add instance level validation skip option #644, thanks to Nitin-Salunke
- Fixed aasm.current_event incorrectly yields nil when calling aasm.fire!(:event) #551 in #638, thanks to DoubleJarvis
- Code Refactor #634 , thanks to rahulknojha
- Fixed callback argument for :before_success & :success callback, #630
- Independent of ActiveSupport methods, #627, thanks to tristandruyen. Fixes #508
- Specify dynamoid version for Rails > 5, #625, thanks to waghanza
- Add travis runner for Rails 5.2, #624, thanks to waghanza
- Cleanup Abstract class issue, #620, thanks to dennym
- Fix Abstract class issue, #619
- Clear failed callbacks, #600, thanks to nedgar
- README improvements, #594, #589, #587, #597, thanks to jackscotti, krmbzds, zegomesjf, BKSpurgeon
- Update InvalidTransition to include state_machine_name #592, thanks to a14m
- Do not add migration if model and column already exists #586, thanks to KiranJosh
- Fix failures array in transition not being reset #383
- Enable AASM scopes to be defined on abstract classes.
- Chore(invokers): Refactor callback invokers, add class-callbacks support #541, thanks to pandomic
- Add docker setup to readme
- Add support for Nobrainer (RethinkDB) #522, thanks to zedtux
- Patch
allow_event
to accept event with custom arguments #419, thanks to czhc
- Add to AASM fire(event) and fire!(event) methods #494, thanks to slayer
- Add
use_transactions
flag to persist changes to the database even when some error occurs. #493, thanks to Peter Lampesberger.
- Fix guards parameter #484, thanks to teohm
- Make errors more inspectable #452, thanks to flexoid
- Enable Dynamoid for Rails 5 #483, thanks to focusshifter
- DRY-up Mongoid and ActiveRecord Persistence, Add Sequel transactions and locking #475, thanks to @Aryk
- Add aliases for event methods #476, thanks to @Aryk
- Support Minitest spec expectations #387, thanks to @faragorn
- Fix thread safe issue with concurrent-ruby gem [see pull-request #422, thanks to @reidmorrison
- Drop Support for Mongo Mapper [see pull-request #439], thanks to @reidmorrison
- add :binding_event option to event [see pull-request #438], thanks to @leanhdaovn
- fix:
skip_validation_on_save: true
for default_scope records, [see pull-request #433], thanks to @larissa - Deep clone state machine during inheritance so that state machines in child classes can be modified (see pull-request #429), thanks to @reidmorrison and @Tybot204
- add before_success callback for event (see pull-request #422), thanks to @timsly
- fix: multiple transitions in a single event with the same to and from states (see issue #372 and issue #362 for details, fixed with pull-request #408, thanks to @dathanb)
- fix: passing nil as a argument to callbacks (see issue #404 for details, fixed with pull-request #406, thanks to @yogeshjain999)
- fix: generator file name when using custom column name instead of aasm_state (see issue #398 for details, thanks to @bastianwegge)
- fix: Scopes when states are defined as a series of symbols (see issue #397 for details, thanks to @evheny0)
- fix: Multiple transition behavior when one of the transitions does not have a "from" parameter (see issue #392 for details)
- fix: permissible states not respecting guard parameters (see issue #388) with pull-request #389
- support
logger
configuration (see issue #370 for details, thanks to @HoyaBoya) - support configuration to let bang transitions fail if object is invalid (see issue #366 and issue #262 for details, thanks to @Wildebeest)
- fix: suppress warnings when using ActiveRecord enums feature (see issue #346 for details, thanks to @110y, and issue #353 for details, thanks to @nathanstitt)
- fix: handle array of success callbacks for transitions properly (see issue #363 for details, thanks to @shunichi)
- support
permitted: false
for states and events query/inspection methods (see issue #364 for details, thanks to @hspazio)
- fix: some issues with RubyMotion (see issue #320 and issue #343 for details, thanks to @Infotaku)
- fix: transitions now work in dup'ed copies (see issue #325 which fixes issue #273 for details, thanks to @lingceng)
- fix: allow skipping the
aasm_ensure_initial_state
callback (see issue #326 for details, thanks to @sineed) - fix: has_many association helper works again for Mongoid (see issue #333 which fixes issue #332 for details, thanks to @anilmaurya)
- improve performance / refactor: load and run only code which is needed (see issue #336 for details, thanks to @csmuc)
- improve: warn when overriding an existing method (see issue #340 which fixes issue #335 for details, thanks to @pirj)
- fix: correct error message (by not evaluating the current state lazily) (see issue #341 which fixes issue #312 for details, thanks to @pirj)
- addition: support for Redis as persistence layer (see issue #190 for details, thanks to @javajax)
- addition: support transition
:success
callbacks (see issue #239 which fixes issue #236 for details, thanks to @brega) - addition: support for namespacing methods and state names (see issue #259 for details, thanks to @allspiritseve)
- addition: support for defining multiple states in one line (see issue #288 which fixes issue #146 for details, thanks to @HParker)
- fix: uninitialised constant when running Rails generator (see issue #339 for details, thanks to @long-long-float)
- add support for callback classes (
after
only) (see issue #316 for details, thanks to @mlr) - allow easier extension of AASM (utilising the idea of ApplicationRecords from Rails 5) (see issue #296 for details, thanks to @mlr)
- support pessimistic locking for ActiveRecord (see issue #283 for details, thanks to @HoyaBoya)
- fix: support database sharding for ActiveRecord (see issue #289 for details, thanks to @scambra)
- fix: some issues with RubyMotion (see issue #318 for details, thanks to @Infotaku)
- fix: Rails generator now features the correct namespace (see issue #328 and issue #329 for details, thanks to @anilmaurya)
- add support for dynamoid (see issue #300 for details, thanks to @LeeChSien)
- make compatible with RubyMotion (see issue #315 for details, thanks to @Infotaku)
- improve error handling in case of an exception during transitioning (see issue #275 for details, thanks to @chriswoodrich)
- rspec matcher
on_event
now supports arguments (see issue #309 for details, thanks to @zacviandier) - fix: permitted states now respect guards (see issue #308 for details, thanks to @eebs)
- fix: reloading the env now doesn't add callbacks twice anymore (see issue #311 for details, thanks to @lingceng)
- fix: allow :send as event name (see issue #257 for details)
- add new callbacks: transactions, all events, ensure (see issue #282 for details, thanks to @HoyaBoya)
- fix: make sure the column is actually present for ActiveRecord enums (see issue #265 and issue #152 for details, thanks to @anilmaurya)
- add generators to configure active_record and mongoid after install (see issue #261 for details, thanks to @anilmaurya)
- fix arity difference between Procs and lambdas (see issue #293 for details)
- make sure to use override configuration options if state machine is defined more than once (see issue #287 for details)
- add RSpec matchers
have_state
,allow_event
andallow_transition_to
(see issue #147 for details) - add RSpec matcher
transition_from
(see issue #178 for details, thanks to @thomasstephane)
- add support for rejecting certain events on inspection (see issue #272 for details, thanks to @dubroe)
- add support global transation callbacks (see issue #221 and issue #253 for details)
- add support (bugfix) for Mongoid >= 5.0 (see issue #277 and issue #278 for details)
- add support for multiple state machines per class (see issue #158 and issue #240 for details)
- special thanks to @evadne for testing this feature, and providing comments and patches (see issue #245 for details)
- support turning off and on the configuration option for
no_direct_assignment
(see issue #223 for details) - event arguments are now passed to
:after_commit
callbacks as well (see issue #238, thanks to @kuinak)
- support block notation for
:after_commit
event callbacks (see issue #224 for details) - event arguments are now passed to state callbacks as well (not only to event callbacks) (see issue #219, thanks to @tobithiel)
AASM::InvalidTransition
now references the current object (with the state machine) and the AASM event name (see issue #217, thanks to @awsmsrc)- bugfix: do not update unloaded state for Sequel (see issue #218, thanks to @godfat)
- bugfix: initialize the aasm state column after initialization of the Mongoid instance (see issue #206, thanks to @Shwetakale )
- added support for mongomapper ORM (see issue #203, thanks to @reidmorrison )
aasm_column
has been removed. Useaasm.attribute_name
insteadaasm_human_event_name
has been removed. Useaasm.human_event_name
instead
- bugfix: may_event_name? should return true or false only (see issue #200 for details)
- bugfix: take private methods into account when checking for callbacks (see issue #197 for details)
- bugfix:
false
is treated as uninitialised state (same asnil
) (see issue #195 for details) - bugfix: an event's
:error
callback now retrieves all arguments passed to the event (see issue #196 for details)
- bugfix: initialize the aasm state column after initialization of the ActiveRecord instance only if the attribute has been loaded (see issue #193 for details)
- corrected callback order in README
- 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