Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
dumbed down driver
Browse files Browse the repository at this point in the history
  • Loading branch information
havelaer committed Dec 5, 2013
1 parent 938a3f3 commit 589d85c
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 320 deletions.
2 changes: 1 addition & 1 deletion config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
password: "admin",
// user: "root",
// password: "F5530A8D59CC1AE8CB100C2A9A11709EC351107A94E4BB29204CB228678BAE69",
database: "blog"
database: "test"
};
34 changes: 15 additions & 19 deletions lib/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ Base.extend.call(Base.prototype, {
*/
init: function() {
this._cid = ++__cid;
this._changed = {};
Base.extend.apply(this, arguments);
this._previous = {};
},

/**
Expand All @@ -111,7 +111,7 @@ Base.extend.call(Base.prototype, {
var value = options, name = attrs;
options = arguments[2];
if (this[name] && this[name] === value) return this;
this._changed[name] = value;
this._previous[name] = this[name];
this[name] = value;
this.trigger('change');
}
Expand Down Expand Up @@ -145,39 +145,35 @@ Base.extend.call(Base.prototype, {
},

/**
* changed
* dirty
*
* @return {object} attributes
*/
changed: function() {
dirty: function() {
var attrs = {};
for(var key in this) {
if (key.charAt(0) === '_') continue;
if (typeof this[key] === 'function') continue;
if (!this.hasOwnProperty(key)) continue;
attrs[key] = this.get(key);
for(var key in this._previous) {
attrs[key] = this[key];
}
return attrs;
},

/**
* previous
* cleanUp
*
* @return {object} attributes
* @return {this}
*/
previous: function() {
return this._changed;
cleanUp: function() {
this._previous = {};
return this;
},

/**
* clearChanges
* previous
*
* @param {string} name attribute
* @return {this}
* @return {object} attributes
*/
clearChanges: function() {
this._changed = {};
return this;
previous: function() {
return this._previous;
},

/**
Expand Down
104 changes: 0 additions & 104 deletions lib/Connection.js

This file was deleted.

91 changes: 0 additions & 91 deletions lib/OClass.js

This file was deleted.

92 changes: 0 additions & 92 deletions lib/Query.js

This file was deleted.

Loading

0 comments on commit 589d85c

Please sign in to comment.