Changeset [6a924d6b1f5afc6349fd8507cc3e59b752113eab] by Dathan Bennett

October 12th, 2016 @ 04:25 PM

Allow multiple transitions in a single event with the same to and from states

As reported in https://github.com/aasm/aasm/issues/372 and https://github.com/aasm/aasm/issues/362,
if two transitions in the same event have the same to and from states but differ in their
guards, if any transition is valid, the first transition is the one that's always executed.
This attempts to resolve that issue.
https://github.com/aasm/aasm/commit/6a924d6b1f5afc6349fd8507cc3e59b...

Committed by Dathan Bennett

  • A spec/models/multiple_transitions_that_differ_only_by_guard.rb
  • A spec/unit/multiple_transitions_that_differ_only_by_guard_spec.rb
  • M lib/aasm/core/event.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.