Skip to content

Commit 6060b7c

Browse files
author
Jon Whiteaker
committed
Only execute update if document attributes is not empty
1 parent 9c40f63 commit 6060b7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

elasticsearch-model/lib/elasticsearch/model/indexing.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def update_document(options={})
426426
type: document_type,
427427
id: self.id,
428428
body: { doc: attributes } }.merge(options)
429-
)
429+
) unless attributes.empty?
430430
else
431431
index_document(options)
432432
end

0 commit comments

Comments
 (0)