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

17 lines
436 B
CoffeeScript

Classroom = require 'models/Classroom'
CocoCollection = require 'collections/CocoCollection'
module.exports = class Classrooms extends CocoCollection
model: Classroom
url: '/db/classroom'
initialize: ->
@on 'sync', =>
for classroom in @models
classroom.capitalizeLanguageName()
super(arguments...)
fetchMine: (options={}) ->
options.data ?= {}
options.data.ownerID = me.id
@fetch(options)