Changeset [a8a8f10d16ce22d69fe72e2aca8ad8da6f0f6cc7] by Reid Morrison

March 16th, 2017 @ 03:28 AM

Make aasm thread-safe. (#442)

Ever since AASM supported multiple named state machines in a single
class, it has accessed and stored its state machines in class variables.
However accesses to the state machines are not thread-safe causing
exceptions when multiple threads attempt to access the same state
machine at the same time during lazy initialization.
Using a Concurrent Map makes calls to state machines, and lazy
initialization thread safe.
https://github.com/aasm/aasm/commit/a8a8f10d16ce22d69fe72e2aca8ad8d...

Committed by Reid Morrison

  • M aasm.gemspec
  • M lib/aasm/state_machine_store.rb
New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Library for adding state machines to Ruby classes. Includes persistence layers for things like ActiveRecord. Formerly known as acts_as_state_machine.