codecombat/app/collections/PatchesCollection.coffee

11 lines
427 B
CoffeeScript
Raw Normal View History

2014-04-11 17:19:17 -04:00
PatchModel = require 'models/Patch'
CocoCollection = require 'collections/CocoCollection'
2014-04-11 17:19:17 -04:00
module.exports = class PatchesCollection extends CocoCollection
model: PatchModel
2014-06-30 22:16:26 -04:00
2014-04-11 17:19:17 -04:00
initialize: (models, options, forModel, @status='pending') ->
super(arguments...)
2015-02-16 17:12:05 -05:00
identifier = if not forModel.get('original') then '_id' else 'original'
@url = "#{forModel.urlRoot}/#{forModel.get(identifier)}/patches?status=#{@status}"