diff --git a/README.md b/README.md index 837c0b6..80189e7 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ Choose what data gets indexed. ```ruby class Product < ActiveRecord::Base def _source - as_json(only: [:name, :active]) + as_json(only: [:name, :active], include: {brand: {only: [:country]}}) end end ``` diff --git a/test/searchkick_test.rb b/test/searchkick_test.rb index c969f72..27e37ec 100644 --- a/test/searchkick_test.rb +++ b/test/searchkick_test.rb @@ -18,7 +18,7 @@ class Product < ActiveRecord::Base conversions: true def _source - as_json.merge(conversions: searches.group("query").count) + as_json.merge conversions: searches.group("query").count end end -- libgit2 0.21.0