Skip to content

Commit

Permalink
Update lib/socialization/stores/redis/base.rb
Browse files Browse the repository at this point in the history
injected block needs to return the memo
  • Loading branch information
AlainPilon committed Aug 15, 2012
1 parent b0ed9f8 commit 5281cbb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/socialization/stores/redis/base.rb
Expand Up @@ -8,6 +8,7 @@ def actors(victim, klass, options = {})
if options[:pluck] if options[:pluck]
Socialization.redis.smembers(generate_forward_key(victim)).inject([]) do |result, element| Socialization.redis.smembers(generate_forward_key(victim)).inject([]) do |result, element|
result << element.match(/\:(\d+)$/)[1] if element.match(/^#{klass}\:/) result << element.match(/\:(\d+)$/)[1] if element.match(/^#{klass}\:/)
result
end end
else else
actors_relation(victim, klass, options).all actors_relation(victim, klass, options).all
Expand All @@ -28,6 +29,7 @@ def victims(actor, klass, options = {})
if options[:pluck] if options[:pluck]
Socialization.redis.smembers(generate_backward_key(actor)).inject([]) do |result, element| Socialization.redis.smembers(generate_backward_key(actor)).inject([]) do |result, element|
result << element.match(/\:(\d+)$/)[1] if element.match(/^#{klass}\:/) result << element.match(/\:(\d+)$/)[1] if element.match(/^#{klass}\:/)
result
end end
else else
victims_relation(actor, klass, options).all victims_relation(actor, klass, options).all
Expand Down

0 comments on commit 5281cbb

Please sign in to comment.