diff --git a/app/models/manager_refresh/save_collection/saver/concurrent_safe_batch.rb b/app/models/manager_refresh/save_collection/saver/concurrent_safe_batch.rb index aec05a35962..5473d866e0b 100644 --- a/app/models/manager_refresh/save_collection/saver/concurrent_safe_batch.rb +++ b/app/models/manager_refresh/save_collection/saver/concurrent_safe_batch.rb @@ -125,7 +125,6 @@ def update_or_destroy_records!(records_batch_iterator, inventory_objects_index, hash end assign_attributes_for_update!(hash_for_update, update_time) - inventory_collection.store_updated_records([{:id => primary_key_value}]) hash_for_update[:id] = primary_key_value hashes_for_update << hash_for_update @@ -163,7 +162,7 @@ def destroy_records!(records) rails_delete = %i(destroy delete).include?(inventory_collection.delete_method) if !rails_delete && inventory_collection.model_class.respond_to?(inventory_collection.delete_method) # We have custom delete method defined on a class, that means it supports batch destroy - # TODO(lsmola) store deleted records to IC + inventory_collection.store_deleted_records(records.map { |x| {:id => record_key(x, primary_key)} }) inventory_collection.model_class.public_send(inventory_collection.delete_method, records.map { |x| record_key(x, primary_key) }) else # We have either standard :destroy and :delete rails method, or custom instance level delete method @@ -185,6 +184,7 @@ def destroy_records!(records) def update_records!(all_attribute_keys, hashes) return if hashes.blank? + inventory_collection.store_updated_records(hashes) query = build_update_query(all_attribute_keys, hashes) get_connection.execute(query) end