Skip to content

Commit

Permalink
Store updated records as a part of batch disconnect
Browse files Browse the repository at this point in the history
Store updated records as a part of batch disconnect
  • Loading branch information
Ladas committed Aug 11, 2017
1 parent 945030c commit 54eb02c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,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
Expand Down

0 comments on commit 54eb02c

Please sign in to comment.