You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aasm column :state do
state :unkown, initial: true
state :matched
event :match do
transitions from: :unknown, to: matched, after: :matched_event
end
def matched_event
puts aasm.current_event # yields nil if triggered with aasm.fire!(:match)
end
end
aasm.match! # => Correct, aasm.current_event yields 'match!'
aasm.fire!(:match) # => Incorrect, aasm.current_event yields nil
Would be nice to get this fixed, as my controllers are beginning to look a lot like hackery (i have 30+ transitions) and have had to resort to this less than elegant code...
def update
...
if model.respond_to?("may_#{params[:event]}?') && model.send("may_#{params[:event]}?")
model.send("#{params[:event]}!")
end
...
end
The text was updated successfully, but these errors were encountered:
Given the following code excerpt:
Would be nice to get this fixed, as my controllers are beginning to look a lot like hackery (i have 30+ transitions) and have had to resort to this less than elegant code...
The text was updated successfully, but these errors were encountered: