diff --git a/core/server/models/base/index.js b/core/server/models/base/index.js index 1800961a2f..c35b31c5a8 100644 --- a/core/server/models/base/index.js +++ b/core/server/models/base/index.js @@ -18,8 +18,7 @@ var _ = require('lodash'), uuid = require('node-uuid'), validation = require('../../data/validation'), baseUtils = require('./utils'), - includeCount = require('./include-count'), - pagination = require('./pagination'), + plugins = require('../plugins'), gql = require('ghost-gql'), ghostBookshelf; @@ -32,10 +31,10 @@ ghostBookshelf = bookshelf(config.database.knex); ghostBookshelf.plugin('registry'); // Load the Ghost include count plugin, which allows for the inclusion of cross-table counts -ghostBookshelf.plugin(includeCount); +ghostBookshelf.plugin(plugins.includeCount); // Load the Ghost pagination plugin, which gives us the `fetchPage` method on Models -ghostBookshelf.plugin(pagination); +ghostBookshelf.plugin(plugins.pagination); // ## ghostBookshelf.Model // The Base Model which other Ghost objects will inherit from, diff --git a/core/server/models/base/include-count.js b/core/server/models/plugins/include-count.js similarity index 100% rename from core/server/models/base/include-count.js rename to core/server/models/plugins/include-count.js diff --git a/core/server/models/plugins/index.js b/core/server/models/plugins/index.js new file mode 100644 index 0000000000..0c3a38d612 --- /dev/null +++ b/core/server/models/plugins/index.js @@ -0,0 +1,4 @@ +module.exports = { + includeCount: require('./include-count'), + pagination: require('./pagination') +}; diff --git a/core/server/models/base/pagination.js b/core/server/models/plugins/pagination.js similarity index 100% rename from core/server/models/base/pagination.js rename to core/server/models/plugins/pagination.js diff --git a/core/test/unit/models_pagination_spec.js b/core/test/unit/models_plugins/pagination_spec.js similarity index 99% rename from core/test/unit/models_pagination_spec.js rename to core/test/unit/models_plugins/pagination_spec.js index 187c81c85d..008505ab83 100644 --- a/core/test/unit/models_pagination_spec.js +++ b/core/test/unit/models_plugins/pagination_spec.js @@ -6,7 +6,7 @@ var should = require('should'), rewire = require('rewire'), // Thing we're testing - pagination = rewire('../../server/models/base/pagination'); + pagination = rewire('../../../server/models/plugins/pagination'); // To stop jshint complaining should.equal(true, true);