Created
December 3, 2013 23:32
-
-
Save bendrucker/7779655 to your computer and use it in GitHub Desktop.
./db exports a Bookshelf instance
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
'use strict' | |
DB = require './db' | |
class Model extends DB.Model | |
constructor: -> | |
super | |
if typeof @authorize is 'function' | |
@on 'saving', @authorize | |
@on 'fetching', @authorize | |
@on 'destroying', @authorize | |
if typeof @validate is 'function' | |
@on 'saving', @validate | |
module.exports = Model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment