Skip to content

Commit

Permalink
Bug fix for array of plain hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
priyankaiyer committed Nov 6, 2014
1 parent a745eca commit 4c66698
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions lib/looksist/hashed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ def inject_attributes_for(array_of_hashes, at, opts)
def inject_attributes_for_array(array_of_hashes, at, opts)
all_values = opts.each_with_object({}) do |opt, acc|
entity_name = __entity__(opt[:bucket_name] || opt[:using])
modified_array = if at.nil?
array_of_hashes.map(&:values)
else
extract_values(array_of_hashes, opt[:using])
end
modified_array = extract_values(array_of_hashes, opt[:using])
keys = modified_array.flatten.compact.uniq
values = Hash[keys.zip(Looksist.redis_service.send("#{entity_name}_for", keys))]
acc[opt[:using]] = values
Expand Down
2 changes: 1 addition & 1 deletion lib/looksist/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Lookist
VERSION = '0.3.8'
VERSION = '0.3.9'
end

0 comments on commit 4c66698

Please sign in to comment.