state-machines / state_machines

Adds support for creating state machines for attributes on any Ruby class
https://github.com/state-machines/state_machines
MIT License
814 stars 91 forks source link

Fixed inconsistent use of :use_transactions #17

Closed rosskevin closed 9 years ago

rosskevin commented 9 years ago

Fixed inconsistent use of :use_transactions (machine.rb), :transaction (option in transition_collection.rb), :use_transaction (attr_reader in transition_collection.rb) and standardized on :use_transactions. Made MachineCollection and TransitionCollection respect the state_machine :use_transactions configuration. Previously, the MachineCollection and TransitionCollection were operating off of hardcoded values, and ignoring the state_machine configuration. Hardcoded defaults remain but are overridden if specified in the state_machine configuration.

In the process, added #resolve_use_transactions to address a corner case where homogeneous state_machine :use_transactions configurations could create indeterminate behavior.

pboling commented 9 years ago

:+1:

seuros commented 9 years ago

Sorry for delay. I was in the :train: .

seuros commented 9 years ago

v0.3.0 out. Thank you @rosskevin