Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 8 column 9
---
parent: model
name: set
type: 'method'
arguments:
- attributes:
type: object
- options
type: object
---| body { | |
| background: url('/path/to/image.png'); | |
| } |
| 'use strict' | |
| expect = require('chai').expect | |
| Sinon = require 'sinon' | |
| Promise = require 'bluebird' | |
| Bookshelf = require '../../lib/db' | |
| Model = require '../../lib/model' | |
| describe 'Models', -> |
| 'use strict' | |
| DB = require './db' | |
| class Model extends DB.Model | |
| constructor: -> | |
| super | |
| if typeof @authorize is 'function' | |
| @on 'saving', @authorize |
| ActualModel = ModelBase.extend({ | |
| related: function() {this.hasOne(OtherModel);} | |
| }); |
---
parent: model
name: set
type: 'method'
arguments:
- attributes:
type: object
- options
type: object
---| define(['EventEmitter', 'bluebird'], function (EventEmitter, Promise) { | |
| 'use strict'; | |
| EventEmitter.prototype.emitThen = function (event) { | |
| var args = Array.prototype.slice(arguments, 1); | |
| return Promise | |
| .bind(this) | |
| .thenReturn(this._events[event] || []) |
| var i = 0; | |
| module.exports = ++i; |
| it('should be able to run normal queries inside transaction blocks', function() { | |
| return knex('accounts') | |
| .returning('id') | |
| .insert({ | |
| first_name: 'Transacting', | |
| last_name: 'User', | |
| email:'transaction-test3@example.com', | |
| logins: 1, | |
| about: 'Lorem ipsum Dolore labore incididunt enim.', |
| var ModelBase = Bookshelf.Model.extend(); | |
| var CollectionBase = Bookshelf.Collection.extend({ | |
| toJSON: function () { | |
| var json = Bookshelf.Collection.toJSON.apply(this, arguments); | |
| json.object = this.model.prototype.object; | |
| return json; | |
| }); | |
| }); |
| module.exports = Bookshelf.Model.extend({ | |
| initialize: function () { | |
| this.on('saving', this.validate); | |
| }, | |
| validate: function () {} | |
| }); |