documentcloud/backbone — pull request #2354 by wereHamster (2013-03-10 15:45:34+00:00)
Title: Copy url from options in the Collection constructor

Sometimes I don't want to create a new derived Collection class just to be able to set the url. I find it easier to pass the url to the constructor inside the options:

var foos = new Backbone.Collection([], { url: "/foos" });

The Collection constructor currently respects two options: `model` and `comparator`, and copies them into instance fields. This commit changes the constructor to do the same for `url`.

Included is a test and a small change in the documentation to list which options the Collection constructor supports.

This is similar to #2109, which is in the same spirit but for Backbone.Model.