Ghost/core/server/data
Katharina Irrgang 48387e4ffd 🎨 tidy up static id (owner, internal, external) usages (#7675)
refs #7494, refs #7495 

This PR is an extracted clean up feature of #7495.
We are using everywhere static id checks (userId === 0 or userId === 1).
This PR moves the static values into the Base model.
This makes it 1. way more readable and 2. we can change the id's in a central place.

I changed the most important occurrences - no tests are touched (yet!).

The background is: when changing from auto increment id (number) to ObjectId's (string) we still need to support id 1 and 0, because Ghost relies on these two static id's.
I would like to support using both: 0/1 as string and 0/1 as number.

1 === owner/internal
0 === external

Another important change:
User Model does not longer define the contextUser method, because i couldn't find a reason?
I looked in Git history, see 6e48275160
2016-11-09 15:01:07 +00:00
..
db utf8mb4 support (#7409) 2016-09-20 15:59:34 +01:00
export Error creation (#7477) 2016-10-06 13:27:35 +01:00
import 🎨 tidy up static id (owner, internal, external) usages (#7675) 2016-11-09 15:01:07 +00:00
importer Error creation (#7477) 2016-10-06 13:27:35 +01:00
meta Move internal tags out of labs (#7519) 2016-10-10 09:51:03 +01:00
migration use migration runner for init db (#7502) 2016-10-11 13:37:11 +01:00
migrations knex-migrator v2 (#7605) 2016-11-07 11:39:49 +00:00
schema 🎨 public client registration updates (#7690) 2016-11-08 14:21:25 +00:00
slack Error creation (#7477) 2016-10-06 13:27:35 +01:00
validation Use moment-timezone when using .tz() (#7653) 2016-10-31 14:44:24 +01:00
xml 🎨 replace process.env.NODE_ENV usages by config.get('env') (#7544) 2016-10-11 13:53:52 +01:00
timezones.json Adds UTC as select option to timezones select list 2016-06-10 15:19:16 +02:00