Module: AASM::Extensions

Included in:
Qcable, Request, TransferRequest
Defined in:
app/models/concerns/aasm/extensions.rb

Overview

Provides extensions to allow for the transtion_to method. This allows RESTful updates of state while still restricting permitted transitions

Instance Method Summary collapse

Instance Method Details

#transition_to(target_state) ⇒ Object

Attempts to transition the object to target_state by detecting any valid state_machine transitions

Parameters:

  • target_state (String)

    A string matching the state name to transition to



13
14
15
# File 'app/models/concerns/aasm/extensions.rb', line 13

def transition_to(target_state)
  aasm.fire!(suggested_transition_to(target_state))
end