Ghost/core/server
kirrg001 355ef54702 Removed isNew usages in model layer
no issue

- `isNew` does not work in Ghost, because Ghost does not use auto increment id's
- see https://github.com/bookshelf/bookshelf/issues/1265
- see https://github.com/bookshelf/bookshelf/blob/0.10.3/src/base/model.js#L211
- we only had one occurance, which was anyway redundant
  - if you add a user, `hasChanged('password') is true
  - if you edit a user and the password has changed, `hasChanged('password')` is true as well

NOTE #1:

1. We can't override `isNew` and throw an error, because bookshelf makes use of `isNew` as well, but it's a fallback if `options.method` is not set.
2. It's hard to re-implement `isNew` based on `options.method`, because then we need to ensure that this value is always set (requires a couple of changes)

NOTE #2:
If we need to differentiate if a model is new or edited, we should manually check for `options.method === insert`.

NOTE #3:
The unit tests are much faster compared to the model integration tests.
I did a comparision with the same test assertion:
  - unit test takes 70ms
  - integration test takes 190ms
2018-02-15 22:11:49 +01:00
..
adapters Moved utils constants to lib/constants 2017-12-14 14:13:40 +01:00
api Sorted out the mixed usages of include and withRelated (#9425) 2018-02-15 10:53:53 +01:00
apps Moved make-absolute-urls to url service 2017-12-14 22:34:37 +01:00
config Update Notification improvements (#9123) 2018-01-09 15:20:00 +01:00
controllers Moved tokens, url safe and safe string utility to lib/security 2017-12-14 13:38:00 +01:00
data 🐛 Fixed migrating from < 1.13 to 1.21 2018-02-07 12:31:21 +01:00
helpers 🐛Fixed {{get}} helper's date comparison (#9454) 2018-02-14 18:33:07 +01:00
lib Added lib.security.password lib 2018-02-15 21:13:04 +01:00
models Removed isNew usages in model layer 2018-02-15 22:11:49 +01:00
public 🛠 🙈 Rename ghost-url.js to ghost-sdk.js (#8767) 2017-07-28 18:23:32 +04:00
services Sorted out the mixed usages of include and withRelated (#9425) 2018-02-15 10:53:53 +01:00
translations Removed html usage in error messages (#9444) 2018-02-07 09:35:48 +01:00
views Fixed error trying to render 404 for missing asset 2017-12-22 20:08:59 +00:00
web 🐛Fixed asset redirects (#9455) 2018-02-14 17:21:31 +01:00
analytics-events.js Cleared out old unused events 2017-12-13 09:08:25 +00:00
filters.js Moved pipeline/sequence to lib/promise 2017-12-13 22:20:02 +01:00
ghost-server.js Always require fs-extra - consistency change 2017-12-13 20:57:11 +01:00
index.js Theme translations and blog localisation (#8437) 2018-01-09 14:50:57 +01:00
overrides.js Set Promise to be Bluebird globally 2017-12-13 20:57:11 +01:00
update-check.js Update Notification improvements (#9123) 2018-01-09 15:20:00 +01:00