-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.4.5, 7.1.2
-
Component/s: None
-
None
https://github.com/mongodb/mongoid/pull/4382 from 2017 added support to _matches?() for keys specifying the index of an array, but
_matches?() gives incorrect results when an array contains hash objects
document: {"occupants" => [{"name" => "Tim"},{"name" => "Logan"}]} selector: {"occupants.2" => {"$exists" => true} document._matches?(selector) # returns true, but should be false selector: {"occupants.non_numeric_key" => {"$exists" => true} document._matches?(selector) # returns true, but should be false
The master branch already has tests and works correctly for these cases,
but 6.4 and 7.1 exhibit the problem.
https://github.com/mongodb/mongoid/compare/6.4.0-stable...jasonpenny:matches-array-with-hashes-6.4.0 and https://github.com/mongodb/mongoid/compare/7.1-stable...jasonpenny:matches-array-with-hashes-7.1 are a potential fix
- is related to
-
MONGOID-4985 Convert Matcher#extract_attribute rspec tests to yaml tests
- Closed
- links to