Permalink
Browse files

Merge pull request #67 from stantona/master

To enqueue, also check the existence of remote_#{column}_url
  • Loading branch information...
2 parents e200cab + 9cbf759 commit 333365ca3db03fd46c069e602ffbe5f67b689126 @lardawge lardawge committed Sep 27, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −2 lib/backgrounder/orm/activerecord.rb
  2. +3 −3 lib/backgrounder/orm/mongoid.rb
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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.