Skip to content
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

[CLEANUP beta] Removes Enumerable.findProperty. #11700

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions packages/ember-runtime/lib/mixins/enumerable.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,22 +560,6 @@ export default Mixin.create({
return this.find(iter.apply(this, arguments));
},

/**
Returns the first item with a property matching the passed value. You
can pass an optional second argument with the target value. Otherwise
this will match any property that evaluates to `true`.

This method works much like the more generic `find()` method.

@method findProperty
@param {String} key the property to test
@param {String} [value] optional value to test against.
@return {Object} found item or `undefined`
@deprecated Use `findBy` instead
@private
*/
findProperty: aliasMethod('findBy'),

/**
Returns `true` if the passed function returns true for every item in the
enumeration. This corresponds with the `every()` method in JavaScript 1.6.
Expand Down
8 changes: 0 additions & 8 deletions packages/ember-runtime/tests/suites/enumerable/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,4 @@ suite.test('should return first undefined property match', function() {
equal(obj.findBy('bar', undefined), ary[1], 'findBy(\'bar\', undefined)');
});

suite.test('should be aliased to findProperty', function() {
var obj;

obj = this.newObject([]);

equal(obj.findProperty, obj.findBy);
});

export default suite;
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ QUnit.module('Model Dep Query Params', {
deepEqual(params, self.expectedModelHookParams, 'the ArticleRoute model hook received the expected merged dynamic segment + query params hash');
self.expectedModelHookParams = null;
}
return articles.findProperty('id', params.id);
return articles.findBy('id', params.id);
}
});

Expand Down Expand Up @@ -443,7 +443,7 @@ QUnit.module('Model Dep Query Params (nested)', {
deepEqual(params, self.expectedModelHookParams, 'the ArticleRoute model hook received the expected merged dynamic segment + query params hash');
self.expectedModelHookParams = null;
}
return site_articles.findProperty('id', params.id);
return site_articles.findBy('id', params.id);
}
});

Expand Down Expand Up @@ -547,7 +547,7 @@ QUnit.module('Model Dep Query Params (nested & more than 1 dynamic segment)', {
deepEqual(params, self.expectedSiteModelHookParams, 'the SiteRoute model hook received the expected merged dynamic segment + query params hash');
self.expectedSiteModelHookParams = null;
}
return sites.findProperty('id', params.site_id);
return sites.findBy('id', params.site_id);
}
});
App.SiteArticleRoute = Ember.Route.extend({
Expand All @@ -556,7 +556,7 @@ QUnit.module('Model Dep Query Params (nested & more than 1 dynamic segment)', {
deepEqual(params, self.expectedArticleModelHookParams, 'the SiteArticleRoute model hook received the expected merged dynamic segment + query params hash');
self.expectedArticleModelHookParams = null;
}
return site_articles.findProperty('id', params.article_id);
return site_articles.findBy('id', params.article_id);
}
});

Expand Down