Add correct nomen setting and revert _post changes

This commit is contained in:
Jacob Gable 2013-05-13 15:19:40 -05:00
parent c49dc73385
commit 13e7a51bb7
2 changed files with 8 additions and 8 deletions

View File

@ -5,6 +5,6 @@
"trailing": true, "trailing": true,
"eqeqeq": true, "eqeqeq": true,
"undef": true, "undef": true,
"nomen": true, "nomen": false,
"white": true "white": true
} }

View File

@ -40,8 +40,8 @@
var posts = JSON.parse(data), var posts = JSON.parse(data),
post; post;
_.each(posts, function (postData) { _.each(posts, function (_post) {
post = new schema.models.Post(postData); post = new schema.models.Post(_post);
post.preCreate(function () { post.preCreate(function () {
post.save(function (error, data) { post.save(function (error, data) {
@ -112,8 +112,8 @@
* @param post * @param post
* @param callback * @param callback
*/ */
DataProvider.prototype.posts.add = function (postData, callback) { DataProvider.prototype.posts.add = function (_post, callback) {
var post = new schema.models.Post(postData); var post = new schema.models.Post(_post);
post.preCreate(function () { post.preCreate(function () {
post.save(callback); post.save(callback);
@ -125,9 +125,9 @@
* @param post * @param post
* @param callback * @param callback
*/ */
DataProvider.prototype.posts.edit = function (postData, callback) { DataProvider.prototype.posts.edit = function (_post, callback) {
schema.models.Post.findOne({where: {id: postData.id}}, function (error, post) { schema.models.Post.findOne({where: {id: _post.id}}, function (error, post) {
post = _.extend(post, postData); post = _.extend(post, _post);
schema.models.Post.updateOrCreate(post, callback); schema.models.Post.updateOrCreate(post, callback);
}); });