appirio-tech/lc1-challenge-service — pull request #19 by gfzabarino (2014-11-11 13:53:29+00:00)
Title: Trying to get underscored fields to work

- Upgraded sequelize to 2.0.0-rc2.
- Changed database schema to use the createTable method when possible and changed all camel case names to underscore.
- Changed all models to have the 'field' attribute set to indicate the real name of fields in the database (and still be able to use camel case names on js).
- Added of a function to controllerHelper.js to convert values to its underscored version. This is used by the getAll method, since apparently sequilize is not respecting the field attribute in some cases.
- Changed all enums values to uppercase.
- Explicitely included createdAt and updatedAt attribtues with their own 'field' setting because model tests were not passing.
- Not working because the hasMany association doesn't respect the foreignKey set in the belongsTo side. It currently inserts its own key, such as ChallengeId (this is happening for files).