Skip to content

Commit

Permalink
Fix bug in InventoryCollection#find_by with non-default ref
Browse files Browse the repository at this point in the history
The ref was not being passed to find() and result was nil.
(lazy_find().load with same params worked.)
  • Loading branch information
cben committed Jul 25, 2017
1 parent d7be775 commit 1359023
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/manager_refresh/inventory_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ def find_by(manager_uuid_hash, ref: :manager_ref)
if !manager_uuid_hash.keys.all? { |x| keys.include?(x) } || manager_uuid_hash.keys.size != keys.size
raise "Allowed find_by ref=#{ref} keys are #{keys}"
end
find(object_index(manager_uuid_hash, :ref => ref))
manager_uuid = object_index(manager_uuid_hash, :ref => ref)
find(manager_uuid, :ref => ref)
end

def lazy_find_by(manager_uuid_hash, ref: :manager_ref, key: nil, default: nil)
Expand Down

0 comments on commit 1359023

Please sign in to comment.