Ghost/core/test/unit
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 Use Promise support which was added in fs-extra 3.x 2017-12-13 20:57:11 +01:00
api Sorted out the mixed usages of include and withRelated (#9425) 2018-02-15 10:53:53 +01:00
apps Moved default-cards app to lib/mobiledoc (#9341) 2017-12-14 14:44:01 +00:00
config fix(config): cleanup absolute path config function (#8641) 2017-07-06 00:04:18 +02:00
controllers Moved labs, auth, permissions, settings, mail, themes to services (#9339) 2017-12-14 03:01:23 +01:00
data Contributor Role (#9315) 2018-02-07 10:46:22 +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 Tidy up unit test files (#9340) 2017-12-14 03:36:50 +01:00
services Sorted out the mixed usages of include and withRelated (#9425) 2018-02-15 10:53:53 +01:00
web Extended ghost version utility (#9278) 2018-01-03 20:20:18 +01:00
filters_spec.js Tidy up unit test files (#9340) 2017-12-14 03:36:50 +01:00