Schemas switching
This commit is contained in:
parent
349931780a
commit
6d1e47ceaf
8
Makefile
8
Makefile
|
@ -56,20 +56,22 @@ about-docs:
|
||||||
GITBRANCH = $(shell git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
|
GITBRANCH = $(shell git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
|
||||||
|
|
||||||
REPO = marcusgreenwood/hatchjs
|
REPO = marcusgreenwood/hatchjs
|
||||||
|
TARGET = origin
|
||||||
FROM = $(GITBRANCH)
|
FROM = $(GITBRANCH)
|
||||||
TO = $(GITBRANCH)
|
TO = $(GITBRANCH)
|
||||||
|
|
||||||
pull:
|
pull:
|
||||||
git pull origin $(FROM)
|
git pull $(TARGET) $(FROM)
|
||||||
|
|
||||||
safe-pull:
|
safe-pull:
|
||||||
git pull origin $(FROM) --no-commit
|
git pull $(TARGET) $(FROM) --no-commit
|
||||||
|
|
||||||
push: test
|
push: test
|
||||||
git push origin $(TO)
|
git push $(TARGET) $(TO)
|
||||||
|
|
||||||
feature:
|
feature:
|
||||||
git checkout -b feature-$(filter-out $@,$(MAKECMDGOALS))
|
git checkout -b feature-$(filter-out $@,$(MAKECMDGOALS))
|
||||||
|
git push -u $(TARGET) feature-$(filter-out $@,$(MAKECMDGOALS))
|
||||||
%:
|
%:
|
||||||
@:
|
@:
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@ jugglingdb-roadmap - The Future of JugglingDB
|
||||||
|
|
||||||
## MODEL CORE
|
## MODEL CORE
|
||||||
|
|
||||||
|
* schema switching
|
||||||
|
* common transaction support
|
||||||
* virtual attributes
|
* virtual attributes
|
||||||
* object presentation modes
|
* object presentation modes
|
||||||
* mass-assignment protection
|
* mass-assignment protection
|
||||||
|
|
|
@ -694,7 +694,7 @@ AbstractClass.prototype.isNewRecord = function () {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
AbstractClass.prototype._adapter = function () {
|
AbstractClass.prototype._adapter = function () {
|
||||||
return this.constructor.schema.adapter;
|
return this.schema.adapter;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -163,11 +163,12 @@ Schema.prototype.define = function defineClass(className, properties, settings)
|
||||||
standartize(properties, settings);
|
standartize(properties, settings);
|
||||||
|
|
||||||
// every class can receive hash of data as optional param
|
// every class can receive hash of data as optional param
|
||||||
var NewClass = function ModelConstructor(data) {
|
var NewClass = function ModelConstructor(data, schema) {
|
||||||
if (!(this instanceof ModelConstructor)) {
|
if (!(this instanceof ModelConstructor)) {
|
||||||
return new ModelConstructor(data);
|
return new ModelConstructor(data);
|
||||||
}
|
}
|
||||||
AbstractClass.call(this, data);
|
AbstractClass.call(this, data);
|
||||||
|
this.schema = schema || this.constructor.schema;
|
||||||
};
|
};
|
||||||
|
|
||||||
hiddenProperty(NewClass, 'schema', schema);
|
hiddenProperty(NewClass, 'schema', schema);
|
||||||
|
|
Loading…
Reference in New Issue