Sha256: 417e446e416c433c13c0b6503e90b6efdb5325feee21f642d229002277ecff34
Contents?: true
Size: 474 Bytes
Versions: 2
Compression:
Stored size: 474 Bytes
Contents
module Approval module RespondForm class Approve < Base validate :ensure_user_cannot_respond_to_my_request private def prepare ::Approval::Request.transaction do request.lock! request.assign_attributes(state: :approved, approved_at: Time.current, respond_user_id: user.id) request.comments.new(user_id: user.id, content: reason) yield(request) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
approval-0.5.0 | app/models/approval/respond_form/approve.rb |
approval-0.4.0 | app/models/approval/respond_form/approve.rb |