Permalink
Browse files

Schemas switching

  • Loading branch information...
1602 committed Mar 31, 2013
1 parent 3499317 commit 6d1e47ceafaee4f514f69716339da17ee34d95fe
Showing with 10 additions and 5 deletions.
  1. +5 −3 Makefile
  2. +2 −0 docs/roadmap.md
  3. +1 −1 lib/model.js
  4. +2 −1 lib/schema.js
View
@@ -56,20 +56,22 @@ about-docs:
GITBRANCH = $(shell git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
REPO = marcusgreenwood/hatchjs
+TARGET = origin
FROM = $(GITBRANCH)
TO = $(GITBRANCH)
pull:
- git pull origin $(FROM)
+ git pull $(TARGET) $(FROM)
safe-pull:
- git pull origin $(FROM) --no-commit
+ git pull $(TARGET) $(FROM) --no-commit
push: test
- git push origin $(TO)
+ git push $(TARGET) $(TO)
feature:
git checkout -b feature-$(filter-out $@,$(MAKECMDGOALS))
+ git push -u $(TARGET) feature-$(filter-out $@,$(MAKECMDGOALS))
%:
@:
View
@@ -19,6 +19,8 @@ jugglingdb-roadmap - The Future of JugglingDB
## MODEL CORE
+* schema switching
+* common transaction support
* virtual attributes
* object presentation modes
* mass-assignment protection
View
@@ -694,7 +694,7 @@ AbstractClass.prototype.isNewRecord = function () {
* @private
*/
AbstractClass.prototype._adapter = function () {
- return this.constructor.schema.adapter;
+ return this.schema.adapter;
};
/**
View
@@ -163,11 +163,12 @@ Schema.prototype.define = function defineClass(className, properties, settings)
standartize(properties, settings);
// 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)) {
return new ModelConstructor(data);
}
AbstractClass.call(this, data);
+ this.schema = schema || this.constructor.schema;
};
hiddenProperty(NewClass, 'schema', schema);

0 comments on commit 6d1e47c

Please sign in to comment.