Module: CarrierWave::Backgrounder::ORM::ActiveRecord
- Includes:
- Base
- Defined in:
- lib/backgrounder/orm/activerecord.rb
Instance Method Summary collapse
- #process_in_background(column, worker = ::CarrierWave::Workers::ProcessAsset) ⇒ Object
- #store_in_background(column, worker = ::CarrierWave::Workers::StoreAsset) ⇒ Object
Instance Method Details
#process_in_background(column, worker = ::CarrierWave::Workers::ProcessAsset) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/backgrounder/orm/activerecord.rb', line 11 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? || remote_#{column}_url.present?) end RUBY end |
#store_in_background(column, worker = ::CarrierWave::Workers::StoreAsset) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/backgrounder/orm/activerecord.rb', line 21 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? || remote_#{column}_url.present?) end RUBY end |