(attributes, options)
| 42 | } |
| 43 | |
| 44 | initialize (attributes, options) { |
| 45 | super.initialize(...arguments) |
| 46 | if (options == null) { options = {} } |
| 47 | this.setProjection(options.project) |
| 48 | if (!this.constructor.className) { |
| 49 | console.error(`${this} needs a className set.`) |
| 50 | } |
| 51 | this.on('sync', this.onLoaded, this) |
| 52 | this.on('error', this.onError, this) |
| 53 | this.on('add', this.onLoaded, this) |
| 54 | this.saveBackup = _.debounce(this.saveBackup, 500) |
| 55 | this.usesVersions = (__guard__(__guard__(this.schema(), x1 => x1.properties), x => x.version) != null) |
| 56 | if (globalVar.application != null ? globalVar.application.testing : undefined) { |
| 57 | this.fakeRequests = [] |
| 58 | return this.on('request', function () { return this.fakeRequests.push(jasmine.Ajax.requests.mostRecent()) }) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | created () { return new Date(parseInt(this.id.substring(0, 8), 16) * 1000) } |
| 63 |
nothing calls this directly
no test coverage detected