Sha256: 3fdd7483422efeca0c15369cbed4c2c5004ae207b17232664b4b94b8688a7ed8

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

module Approval
  module RequestForm
    class Update < Base
      private

        def prepare
          ::Approval::Request.transaction do
            request = user.approval_requests.new
            request.comments.new(user: user, content: reason)
            Array(records).each do |record|
              request.items.new(
                event: "update",
                resource_type: record.class.to_s,
                resource_id: record.id,
                params: record.update_params_for_approval,
              )
            end
            yield(request)
          end
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
approval-0.3.0 lib/approval/models/approval/request_form/update.rb