diff --git a/README.md b/README.md index e0a2503..5edf3b1 100644 --- a/README.md +++ b/README.md @@ -643,6 +643,18 @@ class Product < ActiveRecord::Base end ``` +Reindex conditionally + +```ruby +class Product < ActiveRecord::Base + searchkick callbacks: false + + # add the callbacks manually + after_save :reindex, if: proc{|model| model.name_changed? } # use your own condition + after_destroy :reindex +end +``` + Reindex all models (Rails only) ```sh -- libgit2 0.21.0