projectwonder/wonder — pull request #252 by kierankelleher (2012-07-27 15:34:11+00:00)
Title: Flatten valueForKeyPath result if QualifierOperatorContains selector for in-memory evaluateObject

Ensure in-memory evaluation of QualifierOperatorContains selector has the same result as generated SQL fetch.

When using EOQualifier.QualifierOperatorContains selector with a keyPath that has multiple manyToMany and/or toMany keys
the in-Memory evaluation will incorrectly return false in the cases where the result of the keyPath is nested arrays rather
than a flattened array that represents the effective SQL evaluation for the same qualifier. Thus in-Memory evaluation does
not match the behavior of SQL evaluation in this scenario.

This fix flattens the array object resulting from the valueForKeyPath so that the qualifier will correctly evaluate to true
when checking if the flattened array contains the object being evaluated.

This commit changes the current (incorrect) default behavior, however, just in case someone was working around that default behavior and wants to keep the old behavior, a boolean property `er.extensions.ERXKeyValueQualifier.Contains.flatten` can be added to Properties and set to false to revert to old behavior.