2014-04-28 14:58:58 -07:00
|
|
|
ThangType = require 'models/ThangType'
|
|
|
|
CocoCollection = require 'collections/CocoCollection'
|
|
|
|
|
|
|
|
module.exports = class ThangNamesCollection extends CocoCollection
|
|
|
|
url: '/db/thang.type/names'
|
|
|
|
model: ThangType
|
|
|
|
isCachable: false
|
|
|
|
|
2014-11-25 15:36:24 -08:00
|
|
|
constructor: (@ids) ->
|
|
|
|
super()
|
|
|
|
@ids.sort()
|
|
|
|
if @ids.length > 55
|
|
|
|
console.error 'Too many ids, we\'ll likely go over the GET url kind-of-limit of 2000 characters.'
|
2014-07-01 10:16:26 +08:00
|
|
|
|
2014-05-02 10:31:20 -07:00
|
|
|
fetch: (options) ->
|
|
|
|
options ?= {}
|
2014-11-25 15:36:24 -08:00
|
|
|
_.extend options, {data: {ids: @ids}}
|
2014-05-02 10:31:20 -07:00
|
|
|
super(options)
|