Made the CocoCollection more strict about setting the model property.

This commit is contained in:
Scott Erickson 2014-07-07 10:09:12 -07:00
parent 3151db6fc5
commit 86a3fbacd1

View file

@ -1,7 +1,12 @@
CocoModel = require 'models/CocoModel'
module.exports = class CocoCollection extends Backbone.Collection
loaded: false
model: null
initialize: ->
if not @model
console.error @constructor.name, 'does not have a model defined. This will not do!'
super()
@once 'sync', =>
@loaded = true