From 79d36e86056b548e46299b5c27200ce1d05dff97 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 20 Jan 2014 20:11:48 -0800 Subject: [PATCH] Added reindex conditionally to docs --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+), 0 deletions(-) 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