codecombat/app/collections/CourseInstances.coffee
2016-04-04 15:19:27 -07:00

12 lines
409 B
CoffeeScript

CourseInstance = require 'models/CourseInstance'
CocoCollection = require 'collections/CocoCollection'
module.exports = class CourseInstances extends CocoCollection
model: CourseInstance
url: '/db/course_instance'
fetchByOwner: (ownerID, options={}) ->
ownerID = ownerID.id or ownerID # handle if they pass in a user
options.data ?= {}
options.data.ownerID = ownerID
@fetch(options)