Skip to content

Commit 0afd8b8

Browse files
wykhuhtylerjl
authored andcommitted
[MODEL] Fix Asynchronous Callbacks example
Change `record.as_indexed_json ` to `record.__elasticsearch__.as_indexed_json` in the `Asynchronous Callbacks` example. Fixes elastic#518
1 parent 26563ee commit 0afd8b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

elasticsearch-model/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ class Indexer
534534
case operation.to_s
535535
when /index/
536536
record = Article.find(record_id)
537-
Client.index index: 'articles', type: 'article', id: record.id, body: record.as_indexed_json
537+
Client.index index: 'articles', type: 'article', id: record.id, body: record.__elasticsearch__.as_indexed_json
538538
when /delete/
539539
Client.delete index: 'articles', type: 'article', id: record_id
540540
else raise ArgumentError, "Unknown operation '#{operation}'"

0 commit comments

Comments
 (0)