Skip to content

Commit

Permalink
refactoring lazy document header coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgz committed Aug 7, 2024
1 parent c04033b commit 600c0e8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/esse/lazy_document_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def self.coerce(value)
if value.is_a?(Esse::LazyDocumentHeader)
value
elsif value.is_a?(Esse::Document)
source = value.doc_header
new(id: source[:_id], type: source[:_type], routing: source[:routing], **value.options)
new(id: value.id, type: value.type, routing: value.routing, **value.options)
elsif value.is_a?(Hash)
resp = value.transform_keys do |key|
case key
Expand Down

0 comments on commit 600c0e8

Please sign in to comment.