tgriesser/bookshelf — pull request #437 by jordansexton (2014-07-26 23:06:08+00:00)
Title: Set created_at timestamp when saving with insert

The `created_at` timestamp is not set when a model is being saved using the 'insert' method override option:

```javascript
var Book = Bookshelf.Model.extend({ tableName: 'books', hasTimestamps: true });
Book.forge({ id: 500, title: 'War & Peace' })
.save(null, { method: 'insert' })
.get('attributes')
.then(console.log);
// { id: 500, title: 'War & Peace', created_at: null, updated_at: 'Sat Jul 26 2014 17:56:46 GMT-0500 (CDT)' }
```

This patch sets the `created_at` timestamp if the model `isNew` or if save method is `insert`.