Skip to content
#

bookshelf

Here are 200 public repositories matching this topic...

frames75
frames75 commented Feb 19, 2020

In the tutorial events there is this example:

const User = bookshelf.model('User', {
  tableName: 'users',

  initialize() {
    this.on('saving', (model) => {
      return User.forge({email: model.get('email')}).fetch().then((user) => {
        if (user) 
            throw new Error('That email address already exists')
    

Improve this page

Add a description, image, and links to the bookshelf topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the bookshelf topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.