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,
"eqeqeq": true,
"undef": true,
"nomen": true,
"nomen": false,
"white": true
}

View File

@ -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);
});