From 53acbcd7fcc4f8cced206a99e9aa609ac6a73b7a Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 25 Jul 2013 00:49:45 -0700 Subject: [PATCH] Better example --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 80189e7..539a670 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,15 @@ Choose what data gets indexed. ```ruby class Product < ActiveRecord::Base def _source - as_json(only: [:name, :active], include: {brand: {only: [:country]}}) + as_json only: [:name, :active], include: {brand: {only: [:city]}} + # or + { + name: self.name, + active: self.active, + brand: { + city: self.brand.city + } + } end end ``` -- libgit2 0.21.0