lib/hobo/lifecycles/transition.rb in hobo-1.0.2 vs lib/hobo/lifecycles/transition.rb in hobo-1.0.3
- old
+ new
@@ -32,10 +32,11 @@
attributes & allowed
end
def change_state(record)
- record.lifecycle.become(get_state(record, end_state))
+ record.lifecycle.clear_key unless options[:new_key] || options[:keep_key]
+ return record.lifecycle.become(get_state(record, end_state))
end
def run!(record, user, attributes)
current_state = record.lifecycle.state_name