Skip to content

Instantly share code, notes, and snippets.

@joy4eg
Last active June 17, 2016 11:19
Show Gist options
  • Save joy4eg/ab44931de0606b76d78c8edb4ccffcf0 to your computer and use it in GitHub Desktop.
Save joy4eg/ab44931de0606b76d78c8edb4ccffcf0 to your computer and use it in GitHub Desktop.
Database issue workaroud
--- a/lib/Controllers/DatabaseController.js
+++ b/lib/Controllers/DatabaseController.js
@@ -118,7 +118,6 @@ DatabaseController.prototype.loadSchema = function () {
if (!this.schemaPromise) {
this.schemaPromise = this.schemaCollection().then(function (collection) {
- delete _this.schemaPromise;
return SchemaController.load(collection, _this.adapter);
});
}
--- a/lib/Controllers/SchemaController.js
+++ b/lib/Controllers/SchemaController.js
@@ -544,7 +544,7 @@ var SchemaController = function () {
value: function validateField(className, fieldName, type, freeze) {
var _this5 = this;
- return this.reloadData().then(function () {
+ return Promise.resolve().then(function () {
if (fieldName.indexOf(".") > 0) {
// subdocument key (x.y) => ok if x is of type 'object'
fieldName = fieldName.split(".")[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment