Skip to content

Instantly share code, notes, and snippets.

@jpablobr
Created April 5, 2011 15:40
Show Gist options
  • Save jpablobr/903853 to your computer and use it in GitHub Desktop.
Save jpablobr/903853 to your computer and use it in GitHub Desktop.
[DEVISE] upgrade to 1.2
# [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