lib/looksist/hashed.rb in looksist-0.1.0 vs lib/looksist/hashed.rb in looksist-0.1.1
- old
+ new
@@ -41,9 +41,10 @@
def entity(entity_id)
entity_id.to_s.gsub('_id', '')
end
def inject_attributes_at(hash_offset, opts)
+ return nil unless hash_offset
keys = hash_offset[opts[:using]]
entity_name = entity(opts[:using])
values = Looksist.redis_service.send("#{entity_name}_for", keys)
hash_offset[opts[:populate]] = values
hash_offset