Sha256: 498cd4a1c219841013a924285153ac20a5edb9fcaad84c81a4cde6cce06b3183

Contents?: true

Size: 979 Bytes

Versions: 5

Compression:

Stored size: 979 Bytes

Contents

# encoding: utf-8
require 'active_record'

module CarrierWave
  module Backgrounder
    module ORM

      module ActiveRecord
        include CarrierWave::Backgrounder::ORM::Base

        def process_in_background(column, worker=::CarrierWave::Workers::ProcessAsset)
          super

          class_eval  <<-RUBY, __FILE__, __LINE__ + 1
            def trigger_#{column}_background_processing?
              process_#{column}_upload != true && #{column}_changed?
            end
          RUBY
        end

        def store_in_background(column, worker=::CarrierWave::Workers::StoreAsset)
          super

          class_eval  <<-RUBY, __FILE__, __LINE__ + 1
            def trigger_#{column}_background_storage?
              process_#{column}_upload != true && #{column}_changed?
            end
          RUBY
        end
      end # ActiveRecord

    end # ORM
  end # Backgrounder
end # CarrierWave

ActiveRecord::Base.extend CarrierWave::Backgrounder::ORM::ActiveRecord

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
carrierwave_backgrounder-0.0.7 lib/backgrounder/orm/activerecord.rb
carrierwave_backgrounder-0.0.6 lib/backgrounder/orm/activerecord.rb
carrierwave_backgrounder-0.0.5 lib/backgrounder/orm/activerecord.rb
carrierwave_backgrounder-0.0.4 lib/backgrounder/orm/activerecord.rb
carrierwave_backgrounder-0.0.3 lib/backgrounder/orm/activerecord.rb