'use strict';
var knex = require('knex');
var Bookshelf = require('bookshelf');
var db = knex({ client : 'pg', connection : 'postgres://127.0.0.1' });
Bookshelf.Instance = Bookshelf.initialize(db);
Bookshelf.Instance.plugin('registry');
require('cah-base-model')(Bookshelf.Instance);
require('my-user-module')(Bookshelf.Instance);
'use strict';
module.exports = function(bookshelf, inheritsFrom) {
inheritsFrom = inheritsFrom || 'Base';
bookshelf.model('User', bookshelf.model(inheritsFrom).extend({
tableName : 'users',
initialize : function() { console.log('Created a user model'); }
}));
bookshelf.collection('User', bookshelf.collection(inheritsFrom).extend({
model : bookshelf.model('User')
}));
}