Skip to content

Commit

Permalink
Fix typo (renames -> rename)
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Dec 3, 2013
1 parent 235a310 commit 3c5f362
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions lib/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Model.prototype.find = function (conditions, callback) {
if (!_.isPlainObject(conditions)) conditions = { _id: conditions };

// Handle any renames
for(var upstream in this.options.renames) {
var downstream = this.options.renames[upstream];
for(var upstream in this.options.rename) {
var downstream = this.options.rename[upstream];

if(conditions.hasOwnProperty(upstream)) {
if(conditions.hasOwnProperty(downstream)) delete conditions[downstream];
Expand Down Expand Up @@ -136,8 +136,8 @@ Model.prototype.findOne = Model.prototype.get = function (conditions, callback)
if (!_.isPlainObject(conditions)) conditions = { _id: conditions };

// Handle any renames
for(var upstream in this.options.renames) {
var downstream = this.options.renames[upstream];
for(var upstream in this.options.rename) {
var downstream = this.options.rename[upstream];

if(conditions.hasOwnProperty(upstream)) {
if(conditions.hasOwnProperty(downstream)) delete conditions[downstream];
Expand Down Expand Up @@ -221,8 +221,8 @@ Model.prototype.insert = Model.prototype.create = function (object, callback) {
if(!validation.passed) return prepNext(validation.toError());

// Handle any renames
for(var upstream in $.options.renames) {
var downstream = $.options.renames[upstream];
for(var upstream in $.options.rename) {
var downstream = $.options.rename[upstream];

if(obj.hasOwnProperty(upstream)) {
if(obj.hasOwnProperty(downstream)) delete obj[downstream];
Expand Down Expand Up @@ -268,8 +268,8 @@ Model.prototype.update = function (conditions, changes, callback) {
/// </signature>

// Handle any renames
for(var upstream in this.options.renames) {
var downstream = this.options.renames[upstream];
for(var upstream in this.options.rename) {
var downstream = this.options.rename[upstream];

if(conditions.hasOwnProperty(upstream)) {
if(conditions.hasOwnProperty(downstream)) delete conditions[downstream];
Expand Down Expand Up @@ -301,8 +301,8 @@ Model.prototype.count = function (conditions, callback) {
}

// Handle any renames
for(var upstream in this.options.renames) {
var downstream = this.options.renames[upstream];
for(var upstream in this.options.rename) {
var downstream = this.options.rename[upstream];

if(conditions.hasOwnProperty(upstream)) {
if(conditions.hasOwnProperty(downstream)) delete conditions[downstream];
Expand Down Expand Up @@ -341,8 +341,8 @@ Model.prototype.remove = function (conditions, callback) {
if (!_.isPlainObject(conditions)) conditions = { _id: conditions };

// Handle any renames
for(var upstream in this.options.renames) {
var downstream = this.options.renames[upstream];
for(var upstream in this.options.rename) {
var downstream = this.options.rename[upstream];

if(conditions.hasOwnProperty(upstream)) {
if(conditions.hasOwnProperty(downstream)) delete conditions[downstream];
Expand Down
2 changes: 1 addition & 1 deletion test/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('orm', function () {
model = new Model(db, 'model', {
name: /.+/
}, {
renames: {
rename: {
_id: 'name'
},
transforms: {
Expand Down

0 comments on commit 3c5f362

Please sign in to comment.