Sha256: 13c5123844782a67511b42d5f5e2416b96ff054b550558da7fe08967a9e1dc06

Contents?: true

Size: 514 Bytes

Versions: 4

Compression:

Stored size: 514 Bytes

Contents

module Approval
  module RequestForm
    class Destroy < Base
      private

        def prepare
          ::Approval::Request.transaction do
            request.comments.new(user_id: user.id, content: reason)
            Array(records).each do |record|
              request.items.new(
                event: "destroy",
                resource_type: record.class.to_s,
                resource_id: record.id,
              )
            end
            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/request_form/destroy.rb
approval-0.4.0 app/models/approval/request_form/destroy.rb
approval-0.3.7 app/models/approval/request_form/destroy.rb
approval-0.3.5 lib/approval/models/approval/request_form/destroy.rb