How To: Upgrade to Devise 2.2

gravis edited this page Feb 12, 2013 · 2 revisions
Clone this wiki locally

There are a few things that need to be done when upgrading from 2.1 to 2.2.

Add new i18n key

Add the following key between devise.failure.locked and devise.failure.invalid in the config/locales/devise.en.yml.

not_found_in_database: 'Invalid email or password.'

Add additional parameter to any Mailers you have overridden

For example:

def confirmation_instructions(record)


def confirmation_instructions(record, opts={})


Add responding to JSON

Devise no longer responds to JSON by default. To add this ability, add the following to your config/application.rb.

config.to_prepare do
   DeviseController.respond_to :html, :json

Keeping password minimum length 6

The default minimum password length was changed to 8. To set it back to 6, add the following to config/initializers/devise.rb.

config.password_length = 6..128