Save user password as a bcrypt hash
* Replace password field by password_hash * Add User#password attribute * Implement password hashing and verification with BCrypt mixin
This commit is contained in:
11
db/migrate/20110809130610_add_password_hash_to_users.rb
Normal file
11
db/migrate/20110809130610_add_password_hash_to_users.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddPasswordHashToUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :users, :password_hash, :string
|
||||
remove_column :users, :password
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :users, :password_hash
|
||||
add_column :users, :password, :string
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user