This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert') | |
var knex = require('knex')({ | |
client: 'sqlite3', | |
connection: {filename: ':memory:'} | |
}) | |
var bookshelf = require('bookshelf')(knex) | |
var User = bookshelf.Model.extend({ | |
tableName: 'users', | |
initialize: function() { | |
this.on('updated', function(user) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This will load all model files that exist in the same directory and attach them to the `models` variable. | |
* You can then simply require this file whenever you need it in your application and access the model you | |
* need: | |
* | |
* var models = require('./models/index.js') | |
* var FooModel = models.FooModel | |
*/ | |
var Bookshelf = require('bookshelf') | |
var fs = require('fs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert') | |
var knex = require('knex') | |
var mysql = knex({ | |
client: 'mysql', | |
connection: { | |
database: 'bookshelf_test', | |
user: 'root', | |
encoding: 'utf8' | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local registerLink = display.newText({ | |
parent = loginGroup, | |
text = "Not yet registered?", | |
font = native.systemFont, | |
fontSize = 16 | |
}, { | |
anchorX = 1, | |
anchorY = 0.5, | |
x = rightMargin, | |
y = contentTop + 240, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "bookshelf-bug", | |
"version": "0.1.0", | |
"dependencies": { | |
"bookshelf": "*", | |
"bluebird": "*", | |
"knex": "*", | |
"sqlite3": "*" | |
} | |
} |