-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: filterBy should compare values #8171
Conversation
return this.filter((value) => { | ||
return Boolean(get(value, key)); | ||
return this.filter((record) => { | ||
return Boolean(get(record, key)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 you may want to check the other implementations to make sure I didn't make a similar mistake with them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆 copy paste so useful, so easy to mess up. I eyeballed the rest and they looked good, decided not to write a bunch of soon to be deprecated tests though seemed like overkill.
@@ -97,6 +97,46 @@ module('unit/record-arrays/record-array - DS.RecordArray', function (hooks) { | |||
assert.strictEqual(recordArray[3], undefined); | |||
}); | |||
|
|||
test('#filterBy', async function (assert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you'll want to use deprecatedTest
vs assert.expectDeprecation
both so we know to clean it up later and because it will then get skipped when deprecations are removed and we run the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a perfectly fine place for this test btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆒 thanks. Fixed.
FilterBy can be called with and without a second argument, when the second argument is used the filter should compare that value to the value in the record.
Description
FilterBy can be called with and without a second argument, when the second argument is used the filter should compare that value to the value in the record.
I slapped the test for this in a sort of random spot because I wasn't sure where it goes.
Type of PR
What kind of change is this?