Skip to content

Commit 5a78e6e

Browse files
committed
Use after_commit instead of after_destroy_commit
The bugfix on Mongoid is not released yet, but that should not matter since there is no real reason to turn this back to after_destroy_commit. The behavior is equivalent.
1 parent 19b26fb commit 5a78e6e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/meilisearch-rails.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,8 @@ def meilisearch(options = {}, &block)
482482
super(*args)
483483
end
484484
end
485-
# Currently after_destroy_commit is broken in Mongoid
486-
elsif respond_to?(:after_destroy) && !Utilities.mongo_model?(self)
487-
after_destroy_commit { |searchable| searchable.ms_enqueue_remove_from_index!(ms_synchronous?) }
485+
elsif respond_to?(:after_destroy)
486+
after_commit(on: :destroy) { |searchable| searchable.ms_enqueue_remove_from_index!(ms_synchronous?) }
488487
end
489488
end
490489
end

0 commit comments

Comments
 (0)