mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Normalised how we require models
refs #9866 - if I want to do a project search and looks for model usages e.g. `models.`, then I won't find these usages - normalise how we require models -> consistency
This commit is contained in:
parent
213474835b
commit
727ff183f4
2 changed files with 7 additions and 7 deletions
|
@ -5,7 +5,7 @@ const debug = require('ghost-ignition').debug('api:themes'),
|
||||||
fs = require('fs-extra'),
|
fs = require('fs-extra'),
|
||||||
localUtils = require('./utils'),
|
localUtils = require('./utils'),
|
||||||
common = require('../lib/common'),
|
common = require('../lib/common'),
|
||||||
settingsModel = require('../models/settings').Settings,
|
models = require('../models'),
|
||||||
settingsCache = require('../services/settings/cache'),
|
settingsCache = require('../services/settings/cache'),
|
||||||
themeUtils = require('../services/themes'),
|
themeUtils = require('../services/themes'),
|
||||||
themeList = themeUtils.list;
|
themeList = themeUtils.list;
|
||||||
|
@ -64,7 +64,7 @@ themes = {
|
||||||
.then((_checkedTheme) => {
|
.then((_checkedTheme) => {
|
||||||
checkedTheme = _checkedTheme;
|
checkedTheme = _checkedTheme;
|
||||||
// We use the model, not the API here, as we don't want to trigger permissions
|
// We use the model, not the API here, as we don't want to trigger permissions
|
||||||
return settingsModel.edit(newSettings, options);
|
return models.Settings.edit(newSettings, options);
|
||||||
})
|
})
|
||||||
// Call activate
|
// Call activate
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
* A collection of utilities for handling settings including a cache
|
* A collection of utilities for handling settings including a cache
|
||||||
*/
|
*/
|
||||||
const _ = require('lodash'),
|
const _ = require('lodash'),
|
||||||
SettingsModel = require('../../models/settings').Settings,
|
debug = require('ghost-ignition').debug('services:settings:index'),
|
||||||
|
common = require('../../lib/common'),
|
||||||
|
models = require('../../models'),
|
||||||
SettingsCache = require('./cache'),
|
SettingsCache = require('./cache'),
|
||||||
SettingsLoader = require('./loader'),
|
SettingsLoader = require('./loader'),
|
||||||
ensureSettingsFiles = require('./ensure-settings'),
|
ensureSettingsFiles = require('./ensure-settings');
|
||||||
common = require('../../lib/common'),
|
|
||||||
debug = require('ghost-ignition').debug('services:settings:index');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
init: function init() {
|
init: function init() {
|
||||||
|
@ -21,7 +21,7 @@ module.exports = {
|
||||||
return ensureSettingsFiles(knownSettings)
|
return ensureSettingsFiles(knownSettings)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// Update the defaults
|
// Update the defaults
|
||||||
return SettingsModel.populateDefaults();
|
return models.Settings.populateDefaults();
|
||||||
})
|
})
|
||||||
.then((settingsCollection) => {
|
.then((settingsCollection) => {
|
||||||
// Initialise the cache with the result
|
// Initialise the cache with the result
|
||||||
|
|
Loading…
Add table
Reference in a new issue