Improve messages.

This commit is contained in:
José Valim
2010-11-30 12:23:09 +01:00
parent 089c316f37
commit cb62597afa
2 changed files with 10 additions and 2 deletions

View File

@@ -53,7 +53,14 @@ module Devise
# Returns the class for the configured encryptor.
def encryptor_class
@encryptor_class ||= ::Devise::Encryptors.const_get(encryptor.to_s.classify)
@encryptor_class ||= case encryptor
when :bcrypt
raise "In order to use bcrypt as encryptor, simply remove :encryptable from your devise model"
when nil
raise "You need to give an :encrytor as option in order to use :encryptable"
else
::Devise::Encryptors.const_get(encryptor.to_s.classify)
end
end
def password_salt

View File

@@ -42,7 +42,8 @@ module Devise
else
puts "[DEVISE] You are using #{Devise.encryptor} as encryptor. From version 1.2, " <<
"you need to explicitly add `devise :encryptable, :encryptor => :#{Devise.encryptor}` " <<
"to your models and comment the current value in the config/initializers/devise.rb"
"to your models and comment the current value in the config/initializers/devise.rb. " <<
"You must also add t.encryptable to your existing migrations."
end
end
end