Skip to content

Commit

Permalink
Update embedded.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields authored Aug 27, 2023
1 parent aa5f3ec commit 636d429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoid/attributes/embedded.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def traverse(attributes, path)

attributes = if attributes.try(:key?, key)
attributes[key]
elsif key.match?(/\A\d+\z/) && attributes.respond_to?(:each)
elsif attributes.respond_to?(:each) && key.match?(/\A\d+\z/)
attributes[key.to_i]
end
end
Expand Down

0 comments on commit 636d429

Please sign in to comment.