Major changes to the structure of pages to utilize the flex layout system.
This commit is contained in:
@@ -29,14 +29,10 @@ module.exports = function(sequelize, DataTypes) {
|
||||
updatedAt: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false
|
||||
},
|
||||
deletedAt: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true
|
||||
}
|
||||
}, {
|
||||
freezeTableName: true, // Model tableName will be the same as the model name
|
||||
paranoid: true,
|
||||
paranoid: false,
|
||||
classMethods: {
|
||||
associate: function(models) {
|
||||
Sale.belongsTo(models.Item, {as: 'item', foreignKey: {name: 'itemId', field: 'itemId'}});
|
||||
|
||||
@@ -14,10 +14,10 @@ module.exports = function(sequelize, DataTypes) {
|
||||
login: {
|
||||
type: DataTypes.STRING
|
||||
},
|
||||
password: {
|
||||
password: { //Note: The salt should be stored as part of the hash.
|
||||
type: DataTypes.STRING,
|
||||
set: function(val) {
|
||||
this.setDataValue('password', sequelize.models.User.generateHash(val));
|
||||
this.setDataValue('password', bcrypt.hashSync(val, bcrypt.genSaltSync(8), null));
|
||||
}
|
||||
},
|
||||
admin: {
|
||||
@@ -35,16 +35,8 @@ module.exports = function(sequelize, DataTypes) {
|
||||
freezeTableName: true, // Model tableName will be the same as the model name
|
||||
//paranoid: true, //Keep deleted data but flag it as deleted
|
||||
comment: "A system user authorized to access and manipulate the application data.",
|
||||
classMethods: {
|
||||
generateHash: function(password) {
|
||||
return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
|
||||
}
|
||||
},
|
||||
instanceMethods: {
|
||||
generateHash: function(password) {
|
||||
return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
|
||||
},
|
||||
validPassword: function(password) {
|
||||
isPasswordValid: function(password) {
|
||||
return bcrypt.compareSync(password, this.password);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user