Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request lardawge#67 from stantona/master
Browse files Browse the repository at this point in the history
To enqueue, also check the existence of remote_#{column}_url
  • Loading branch information
lardawge committed Sep 27, 2012
2 parents e200cab + 9cbf759 commit 333365c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/backgrounder/orm/activerecord.rb
Expand Up @@ -13,7 +13,7 @@ def process_in_background(column, worker=::CarrierWave::Workers::ProcessAsset)

class_eval <<-RUBY, __FILE__, __LINE__ + 1
def trigger_#{column}_background_processing?
process_#{column}_upload != true && #{column}_changed?
super && (#{column}_changed? || remote_#{column}_url.present?)
end
RUBY
end
Expand All @@ -23,7 +23,7 @@ def store_in_background(column, worker=::CarrierWave::Workers::StoreAsset)

class_eval <<-RUBY, __FILE__, __LINE__ + 1
def trigger_#{column}_background_storage?
process_#{column}_upload != true && #{column}_changed?
super && (#{column}_changed? || remote_#{column}_url.present?)
end
RUBY
end
Expand Down
6 changes: 3 additions & 3 deletions lib/backgrounder/orm/mongoid.rb
Expand Up @@ -10,7 +10,7 @@ def process_in_background(column, worker=::CarrierWave::Workers::ProcessAsset)

class_eval <<-RUBY, __FILE__, __LINE__ + 1
def trigger_#{column}_background_processing?
process_#{column}_upload != true && #{column}_changed?
super && (#{column}_changed? || remote_#{column}_url.present?)
end
RUBY
end
Expand All @@ -20,7 +20,7 @@ def store_in_background(column, worker=::CarrierWave::Workers::StoreAsset)

class_eval <<-RUBY, __FILE__, __LINE__ + 1
def trigger_#{column}_background_storage?
process_#{column}_upload != true && #{column}_changed?
super && (#{column}_changed? || remote_#{column}_url.present?)
end
RUBY
end
Expand All @@ -30,4 +30,4 @@ def trigger_#{column}_background_storage?
end # Backgrounder
end # CarrierWave

Mongoid::Document::ClassMethods.send(:include, ::CarrierWave::Backgrounder::ORM::Mongoid)
Mongoid::Document::ClassMethods.send(:include, ::CarrierWave::Backgrounder::ORM::Mongoid)

0 comments on commit 333365c

Please sign in to comment.