-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 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 6e48275
- Loading branch information
Showing
5 changed files
with
36 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters