diff --git a/app/models/ems_refresh/save_inventory_helper.rb b/app/models/ems_refresh/save_inventory_helper.rb index e6b13ec8224..1d577e9108d 100644 --- a/app/models/ems_refresh/save_inventory_helper.rb +++ b/app/models/ems_refresh/save_inventory_helper.rb @@ -119,7 +119,7 @@ def store_ids_for_new_records(records, hashes, keys) hashes_index[build_index_from_hash(keys, hash)] = hash end - records.find_each do |record| + records.uniq.each do |record| record_index = build_index_from_record(keys, record) hash = hashes_index[record_index] hash[:id] = record.id if hash