(options)
| 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 = {} } |
no test coverage detected