Sha256: 88e97acebb24008c621de739b8c399582a629376cf087d224048e1660ac86b43

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

module ModelTransporter
  module ControllerAdditions
    extend ActiveSupport::Concern

    included do
      around_action :batch_model_updates
    end

    def batch_model_updates(&block)
      if ModelTransporter.configuration.actor
        actor = Proc.new do
          ModelTransporter.configuration.actor.to_proc.call(self)
        end
      end

      ModelTransporter::BatchModelUpdates.with_transporter_actor(actor) do
        ModelTransporter::BatchModelUpdates.batch_model_updates(&block)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
model_transporter-0.1.0 lib/model_transporter/controller_additions.rb