var Backbone = require('./backbone');
var _ = require('underscore');

module.exports = Backbone.Collection;

Backbone.Collection.toString = function() {
    return '<Collection ' + this.title + '>';
};

Backbone.Collection.register = function(app) {
    // Add the collection if it's not a server-only collection.
    this.files.forEach(function(filename) {
        if (!(/\.server\.bones$/).test(filename) && app.assets) {
            app.assets.models.push(filename);
        }
    });

    app.models[this.title] = this;
};

Backbone.Collection.prototype.toString = function() {
    return '[Collection ' + this.constructor.title + ']';
};

@@ -381,16 +381,23 @@
 r%5C.bones
+(%5C.js%7C)
 $/).test
@@ -420,16 +420,71 @@
 p.assets
+ &&%0A            app.assets.models.indexOf(filename) %3C 0
 ) %7B%0A    

Switch collections to new .js file format.