MCPcopy Index your code
hub / github.com/codecombat/codecombat / patch

Method patch

app/models/CocoModel.js:272–289  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

270 }
271
272 patch (options) {
273 if (!this._revertAttributes) { return false }
274 if (options == null) { options = {} }
275 options.patch = true
276 options.type = 'PUT'
277
278 const attrs = { _id: this.id }
279 const keys = []
280 for (const key of Array.from(_.keys(this.attributes))) {
281 if (!_.isEqual(this.attributes[key], this._revertAttributes[key])) {
282 attrs[key] = this.attributes[key]
283 keys.push(key)
284 }
285 }
286
287 if (!keys.length) { return }
288 return this.save(attrs, options)
289 }
290
291 fetch (options) {
292 if (!options) { options = {} }

Callers 15

CocoModel.spec.jsFile · 0.80
deltas.jsFile · 0.80
expandFlattenedDeltaFunction · 0.80
initFunction · 0.80
setTestGroupNumberUSFunction · 0.80
funMethod · 0.80
trackReferrersMethod · 0.80
toggleSoundFunction · 0.80
onCheckboxChangedMethod · 0.80

Calls 1

saveMethod · 0.95

Tested by

no test coverage detected