Skip to content

Commit 04dd84c

Browse files
committed
Merge pull request #11700 from duggiefresh/cleanup-remove-findproperty
[CLEANUP beta] Removes `Enumerable.findProperty`.
2 parents 4b9145c + 04e12d0 commit 04dd84c

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

packages/ember-runtime/lib/mixins/enumerable.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -560,22 +560,6 @@ export default Mixin.create({
560560
return this.find(iter.apply(this, arguments));
561561
},
562562

563-
/**
564-
Returns the first item with a property matching the passed value. You
565-
can pass an optional second argument with the target value. Otherwise
566-
this will match any property that evaluates to `true`.
567-
568-
This method works much like the more generic `find()` method.
569-
570-
@method findProperty
571-
@param {String} key the property to test
572-
@param {String} [value] optional value to test against.
573-
@return {Object} found item or `undefined`
574-
@deprecated Use `findBy` instead
575-
@private
576-
*/
577-
findProperty: aliasMethod('findBy'),
578-
579563
/**
580564
Returns `true` if the passed function returns true for every item in the
581565
enumeration. This corresponds with the `every()` method in JavaScript 1.6.

packages/ember-runtime/tests/suites/enumerable/find.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,4 @@ suite.test('should return first undefined property match', function() {
102102
equal(obj.findBy('bar', undefined), ary[1], 'findBy(\'bar\', undefined)');
103103
});
104104

105-
suite.test('should be aliased to findProperty', function() {
106-
var obj;
107-
108-
obj = this.newObject([]);
109-
110-
equal(obj.findProperty, obj.findBy);
111-
});
112-
113105
export default suite;

packages/ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ QUnit.module('Model Dep Query Params', {
352352
deepEqual(params, self.expectedModelHookParams, 'the ArticleRoute model hook received the expected merged dynamic segment + query params hash');
353353
self.expectedModelHookParams = null;
354354
}
355-
return articles.findProperty('id', params.id);
355+
return articles.findBy('id', params.id);
356356
}
357357
});
358358

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

@@ -547,7 +547,7 @@ QUnit.module('Model Dep Query Params (nested & more than 1 dynamic segment)', {
547547
deepEqual(params, self.expectedSiteModelHookParams, 'the SiteRoute model hook received the expected merged dynamic segment + query params hash');
548548
self.expectedSiteModelHookParams = null;
549549
}
550-
return sites.findProperty('id', params.site_id);
550+
return sites.findBy('id', params.site_id);
551551
}
552552
});
553553
App.SiteArticleRoute = Ember.Route.extend({
@@ -556,7 +556,7 @@ QUnit.module('Model Dep Query Params (nested & more than 1 dynamic segment)', {
556556
deepEqual(params, self.expectedArticleModelHookParams, 'the SiteArticleRoute model hook received the expected merged dynamic segment + query params hash');
557557
self.expectedArticleModelHookParams = null;
558558
}
559-
return site_articles.findProperty('id', params.article_id);
559+
return site_articles.findBy('id', params.article_id);
560560
}
561561
});
562562

0 commit comments

Comments
 (0)