lib/approval/models/approval/respond_form/cancel.rb in approval-0.2.3 vs lib/approval/models/approval/respond_form/cancel.rb in approval-0.3.0
- old
+ new
@@ -2,10 +2,10 @@
module RespondForm
class Cancel < Base
private
def prepare
- ::ActiveRecord::Base.transaction do
+ ::Approval::Request.transaction do
request.lock!
request.assign_attributes(state: :cancelled, cancelled_at: Time.current, respond_user: user)
request.comments.new(user: user, content: reason)
yield(request)
end