Rename Schema => SchemaController (#1542)

* Rename Schema to SchemaController

* Rename Schema => SchemaController

* Move to controllers folder

* Move SchemasController to Controllers folder

* remove ./..
This commit is contained in:
Drew
2016-04-18 18:59:57 -07:00
parent 0708af17d7
commit 61b62e4e9f
7 changed files with 18 additions and 19 deletions

View File

@@ -6,7 +6,7 @@ import intersect from 'intersect';
var mongodb = require('mongodb');
var Parse = require('parse/node').Parse;
var Schema = require('./../Schema');
var SchemaController = require('../Controllers/SchemaController');
const deepcopy = require('deepcopy');
function DatabaseController(adapter, { skipValidation } = {}) {
@@ -48,7 +48,7 @@ DatabaseController.prototype.validateClassName = function(className) {
if (this.skipValidation) {
return Promise.resolve();
}
if (!Schema.classNameIsValid(className)) {
if (!SchemaController.classNameIsValid(className)) {
const error = new Parse.Error(Parse.Error.INVALID_CLASS_NAME, 'invalid className: ' + className);
return Promise.reject(error);
}
@@ -63,7 +63,7 @@ DatabaseController.prototype.loadSchema = function(acceptor = () => true) {
if (!this.schemaPromise) {
this.schemaPromise = this.schemaCollection().then(collection => {
delete this.schemaPromise;
return Schema.load(collection, this.adapter);
return SchemaController.load(collection, this.adapter);
});
return this.schemaPromise;
}
@@ -74,7 +74,7 @@ DatabaseController.prototype.loadSchema = function(acceptor = () => true) {
}
this.schemaPromise = this.schemaCollection().then(collection => {
delete this.schemaPromise;
return Schema.load(collection, this.adapter);
return SchemaController.load(collection, this.adapter);
});
return this.schemaPromise;
});