Sha256: 5d96c07e18c574c1acbbfdbbf53cf5540eeb2ef20e34986a4cb939067e223a39

Contents?: true

Size: 417 Bytes

Versions: 4

Compression:

Stored size: 417 Bytes

Contents

module Approval
  module RespondForm
    class Cancel < Base
      private

        def prepare
          ::Approval::Request.transaction do
            request.lock!
            request.assign_attributes(state: :cancelled, cancelled_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

4 entries across 4 versions & 1 rubygems

Version Path
approval-0.5.0 app/models/approval/respond_form/cancel.rb
approval-0.4.0 app/models/approval/respond_form/cancel.rb
approval-0.3.7 app/models/approval/respond_form/cancel.rb
approval-0.3.5 lib/approval/models/approval/respond_form/cancel.rb