lib/rocket_job/plugins/state_machine.rb in rocketjob-2.1.3 vs lib/rocket_job/plugins/state_machine.rb in rocketjob-3.0.0.alpha
- old
+ new
@@ -84,16 +84,10 @@
attr_name = self.class.aasm(name).attribute_name
old_value = read_attribute(attr_name)
write_attribute(attr_name, state)
begin
- if aasm_skipping_validations(name)
- saved = save(validate: false)
- write_attribute(attr_name, old_value) unless saved
- saved
- else
- save!
- end
+ save!
rescue Exception => exc
write_attribute(attr_name, old_value)
raise(exc)
end
end