From 13e7a51bb78a1c2e73d14a2f0ef6a0ff37d6488b Mon Sep 17 00:00:00 2001 From: Jacob Gable Date: Mon, 13 May 2013 15:19:40 -0500 Subject: [PATCH] Add correct nomen setting and revert _post changes --- .jshintrc | 2 +- core/shared/models/dataProvider.juggling.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.jshintrc b/.jshintrc index 96b507fb98..c4936ccd81 100644 --- a/.jshintrc +++ b/.jshintrc @@ -5,6 +5,6 @@ "trailing": true, "eqeqeq": true, "undef": true, - "nomen": true, + "nomen": false, "white": true } \ No newline at end of file diff --git a/core/shared/models/dataProvider.juggling.js b/core/shared/models/dataProvider.juggling.js index 318ce90a3b..e5a147c5da 100644 --- a/core/shared/models/dataProvider.juggling.js +++ b/core/shared/models/dataProvider.juggling.js @@ -40,8 +40,8 @@ var posts = JSON.parse(data), post; - _.each(posts, function (postData) { - post = new schema.models.Post(postData); + _.each(posts, function (_post) { + post = new schema.models.Post(_post); post.preCreate(function () { post.save(function (error, data) { @@ -112,8 +112,8 @@ * @param post * @param callback */ - DataProvider.prototype.posts.add = function (postData, callback) { - var post = new schema.models.Post(postData); + DataProvider.prototype.posts.add = function (_post, callback) { + var post = new schema.models.Post(_post); post.preCreate(function () { post.save(callback); @@ -125,9 +125,9 @@ * @param post * @param callback */ - DataProvider.prototype.posts.edit = function (postData, callback) { - schema.models.Post.findOne({where: {id: postData.id}}, function (error, post) { - post = _.extend(post, postData); + DataProvider.prototype.posts.edit = function (_post, callback) { + schema.models.Post.findOne({where: {id: _post.id}}, function (error, post) { + post = _.extend(post, _post); schema.models.Post.updateOrCreate(post, callback); });