mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03: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
@ -5,7 +5,7 @@ const debug = require('ghost-ignition').debug('api:themes'),
|
||||
fs = require('fs-extra'),
|
||||
localUtils = require('./utils'),
|
||||
common = require('../lib/common'),
|
||||
settingsModel = require('../models/settings').Settings,
|
||||
models = require('../models'),
|
||||
settingsCache = require('../services/settings/cache'),
|
||||
themeUtils = require('../services/themes'),
|
||||
themeList = themeUtils.list;
|
||||
@ -64,7 +64,7 @@ themes = {
|
||||
.then((_checkedTheme) => {
|
||||
checkedTheme = _checkedTheme;
|
||||
// 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
|
||||
.then(() => {
|
||||
|
@ -3,12 +3,12 @@
|
||||
* A collection of utilities for handling settings including a cache
|
||||
*/
|
||||
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'),
|
||||
SettingsLoader = require('./loader'),
|
||||
ensureSettingsFiles = require('./ensure-settings'),
|
||||
common = require('../../lib/common'),
|
||||
debug = require('ghost-ignition').debug('services:settings:index');
|
||||
ensureSettingsFiles = require('./ensure-settings');
|
||||
|
||||
module.exports = {
|
||||
init: function init() {
|
||||
@ -21,7 +21,7 @@ module.exports = {
|
||||
return ensureSettingsFiles(knownSettings)
|
||||
.then(() => {
|
||||
// Update the defaults
|
||||
return SettingsModel.populateDefaults();
|
||||
return models.Settings.populateDefaults();
|
||||
})
|
||||
.then((settingsCollection) => {
|
||||
// Initialise the cache with the result
|
||||
|
Loading…
Reference in New Issue
Block a user