Skip to content

Commit

Permalink
Merge pull request #11700 from duggiefresh/cleanup-remove-findproperty
Browse files Browse the repository at this point in the history
[CLEANUP beta] Removes `Enumerable.findProperty`.
  • Loading branch information
stefanpenner committed Jul 9, 2015
2 parents 4b9145c + 04e12d0 commit 04dd84c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
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

0 comments on commit 04dd84c

Please sign in to comment.