Skip to content

Commit

Permalink
Resource.create does a save() on a new instance
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed May 24, 2010
1 parent 42e3f71 commit 6aadc31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resourcer/resource.js
Expand Up @@ -66,8 +66,8 @@ this.Resource._request = function (/* method, [key, obj], callback */) {
this.Resource.get = function (id, callback) {
return this._request("get", id, callback);
};
this.Resource.create = function (obj, callback) {
return this._request("create", obj.key, obj, callback);
this.Resource.create = function (attrs, callback) {
return new(this)(attrs).save(callback);
};
this.Resource.save = function (obj, callback) {
return this._request("save", obj.key, obj, callback);
Expand Down

0 comments on commit 6aadc31

Please sign in to comment.