Closed apsoto closed 11 years ago
Hold on, that bumps the dependency to 1.4.4...
reason I noticed is that the backbone docs defers to the underscore collection method docs, which has findWhere() documented.
@tgriesser Nope, no dependency bump...look at the change (it mirrors the underscore implementation, as one would expect).
My mistake @caseywebdev, should have looked first!
Looks like findWhere is missing from Backbone.Collection() in 1.0.0
@globexdesigns No, but it's listed separately from the Underscore collection functions
But when I do:
var collection = new Backbone.Collection() console.log(collection.findWhere)
it returns "undefined"
@globexdesigns Are you sure you're running Backbone 1.0.0?
Here it's in the code: https://github.com/documentcloud/backbone/blob/master/backbone.js#L814-816
Here's a fiddle, run it and check the console. You'll see:
function (attrs) {
return this.where(attrs, true);
}
Didn't he say findWhere, not where?
Sincerely, Joseph Chapman Managing Director & Principal Developer Creatify Limited http://creatify-limited.com http://josephchapman.com
On 27 Apr 2013, at 08:51, Kim Joar Bekkelund notifications@github.com wrote:
@globexdesigns Are you sure you're running Backbone 1.0.0?
Here it's in the code: https://github.com/documentcloud/backbone/blob/master/backbone.js#L814-816
Here's a fiddle, run it and check the console. You'll see:
function (attrs) { return this.where(attrs, true); } — Reply to this email directly or view it on GitHub.
Ok, so maybe there's some condition that's occurring in my code that's causing the function to get undefined. I'll take a look and get back to you. But based on earlier comments, it seems I'm not the only one that this happened to.
Yeah, collection.findWhere doesn't seem to work. I just used _.findWhere.(collection.models, function(.....
Yup. I was not using 1.0.0. This is a non-issue.
Not sure if Collections are proxying all the collection methods, but I noticed that findWhere() is not available.