Skip to content
Browse files

Use .present? instead of checking for non-empty string.

  • Loading branch information...
1 parent de51916 commit 9cbf759cf6e8e6dc820a42c5a59a63d25a9693dd @stantona stantona committed Sep 24, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/backgrounder/orm/activerecord.rb
  2. +2 −2 lib/backgrounder/orm/mongoid.rb
View
4 lib/backgrounder/orm/activerecord.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?
- super && (#{column}_changed? || remote_#{column}_url.empty? == false)
+ 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?
- super && (#{column}_changed? || remote_#{column}_url.empty? == false)
+ super && (#{column}_changed? || remote_#{column}_url.present?)
end
RUBY
end
View
4 lib/backgrounder/orm/mongoid.rb
@@ -10,7 +10,7 @@ def process_in_background(column, worker=::CarrierWave::Workers::ProcessAsset)
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def trigger_#{column}_background_processing?
- super && (#{column}_changed? || remote_#{column}_url.empty? == false)
+ 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?
- super && (#{column}_changed? || remote_#{column}_url.empty? == false)
+ super && (#{column}_changed? || remote_#{column}_url.present?)
end
RUBY
end

0 comments on commit 9cbf759

Please sign in to comment.
Something went wrong with that request. Please try again.