From 5a6bcb7f7d422f653ad702bb66b3c2e84e3c4134 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 27 Sep 2016 21:35:39 -0700 Subject: [PATCH] Better example for controlling which records are indexed - #735 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09a0aec..7eae6ad 100644 --- a/README.md +++ b/README.md @@ -374,10 +374,12 @@ class Product < ActiveRecord::Base end ``` -By default, all records are indexed. To control which records are indexed, use the `should_index?` method. +By default, all records are indexed. To control which records are indexed, use the `should_index?` method together with the `search_import` scope. ```ruby class Product < ActiveRecord::Base + scope :search_import, -> { where(active: true) } + def should_index? active # only index active records end -- libgit2 0.21.0