documentcloud/backbone — pull request #991 by emersonvinicius (2012-02-12 15:23:09+00:00)
Title: added getBy method to collection

I don't know why this method does not exist, but I believe it is very userful.
It is like find_by_{column} in Rails.

I needed this because my app use friendly url, then I need find model by passed value in slug column

How use:

new Book({
title: "One Thousand and One Nights",
author: "Scheherazade"
});

var Library = Backbone.Collection.extend({
model: Book
});

var library = new Library()
book = library.getBy("author", "Scheherazade")
book // { title: "One Thousand and One Nights", author: "Scheherazade"}