Skip to content

Commit

Permalink
fix test failure - empty list evals to false
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Conway committed Jun 8, 2011
1 parent 07a88f4 commit 9128621
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/resque/plugins/dynamic_queues/attributes.rb
Expand Up @@ -4,7 +4,17 @@ module DynamicQueues
module Attributes

def get_dynamic_queue(key)
redis.lrange("dynamic_queue:#{key}", 0, -1) || redis.lrange("dynamic_queue:default", 0, -1) || Resque.queues
queue_names = redis.lrange("dynamic_queue:#{key}", 0, -1)

if queue_names.nil? || queue_names.size == 0
queue_names = redis.lrange("dynamic_queue:default", 0, -1)
end

if queue_names.nil? || queue_names.size == 0
queue_names = Resque.queues
end

return queue_names
end

def set_dynamic_queue(key, values)
Expand Down

0 comments on commit 9128621

Please sign in to comment.