codecombat/app/collections/PatchesCollection.coffee
2015-02-16 17:12:05 -05:00

10 lines
427 B
CoffeeScript

PatchModel = require 'models/Patch'
CocoCollection = require 'collections/CocoCollection'
module.exports = class PatchesCollection extends CocoCollection
model: PatchModel
initialize: (models, options, forModel, @status='pending') ->
super(arguments...)
identifier = if not forModel.get('original') then '_id' else 'original'
@url = "#{forModel.urlRoot}/#{forModel.get(identifier)}/patches?status=#{@status}"