Created
April 5, 2011 15:40
-
-
Save jpablobr/903853 to your computer and use it in GitHub Desktop.
[DEVISE] upgrade to 1.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [DEVISE] From version 1.2, there is no need to set your encryptor to | |
# bcrypt since encryptors are only enabled if you include :encryptable | |
# in your models. To update your app, please: | |
# 1) Remove config.encryptor from your initializer; | |
# 2) Add t.encryptable to your old migrations; | |
# 3) [Optional] Remove password_salt in a new recent migration. Bcrypt | |
# does not require it anymore. | |
# $ rails g migration AddEncryptableToUsers | |
class AddEncryptableToUsers < ActiveRecord::Migration | |
def self.up | |
change_table :users do |t| | |
t.encryptable | |
end | |
end | |
def self.down | |
remove_column :users, :encryptable | |
end | |
end | |
# $ rake db:migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment