Permalink
Browse files

use blank instead of nil and empty

  • Loading branch information...
1 parent 96bb1b2 commit 90ec1ba07842c80443d4776ddca6c74e938117d0 ganesh committed Feb 21, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/resque/worker.rb
View
@@ -39,12 +39,12 @@ def self.working
begin
reportedly_working = redis.mapped_mget(*names).reject do |key, value|
- value.nil? || value.empty?
+ value.blank?
end
rescue Redis::Distributed::CannotDistribute
names.each do |name|
value = redis.get name
- reportedly_working[name] = value unless value.nil? || value.empty?
+ reportedly_working[name] = value unless value.blank?
end
end
@@ -97,7 +97,7 @@ def initialize(*queues)
#
# You probably never need to call this.
def validate_queues
- if @queues.nil? || @queues.empty?
+ if @queues.blank?
raise NoQueueError.new("Please give each worker at least one queue.")
end
end

0 comments on commit 90ec1ba

Please sign in to comment.