lib/hobo/lifecycles/transition.rb in hobo-0.8 vs lib/hobo/lifecycles/transition.rb in hobo-0.8.1
- old
+ new
@@ -34,11 +34,12 @@
end
def run!(record, user, attributes)
if prepare_and_check!(record, user, attributes)
- fire_event(record, on_transition)
- record.become end_state
+ if record.lifecycle.become end_state
+ fire_event(record, on_transition)
+ end
else
raise Hobo::Model::PermissionDeniedError
end
end