Closed mhmaguire closed 2 years ago
hmmm i see that source for 1.2.0 doesn't support symbol method names so perhaps this is a non issue
Yeah, the documentation still needs to be corrected. The conditional event transitions should only show the proc
example.
For anyone who wants to use the same proc in multiple places (like an instance method), you can store the proc to a constant like this:
TRANSITIONS_TO_ANOTHER_STATE = proc do |record|
record.should_transition?
end
workflow do
state :default do
event :something_happened, transitions_to: :another_state, if: TRANSITIONS_TO_ANOTHER_STATE
end
end
Condition on an event doesn't take method name symbol as indicated in the documentation
with 1.2.0