1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Improve messages.

This commit is contained in:
José Valim 2011-12-19 13:21:17 +01:00
parent 059d3856cf
commit 7ba37b5dc0
4 changed files with 14 additions and 14 deletions

View file

@ -227,16 +227,16 @@ module Devise
@@apply_schema = true
def self.remember_across_browsers=(value)
puts "\n[DEVISE] Devise.remember_across_browsers is deprecated and has no effect. Please remove it."
warn "\n[DEVISE] Devise.remember_across_browsers is deprecated and has no effect. Please remove it."
end
def self.confirm_within=(value)
puts "\n[DEVISE] Devise.confirm_within= is deprecated. Please set Devise.allow_unconfirmed_access_for= instead."
warn "\n[DEVISE] Devise.confirm_within= is deprecated. Please set Devise.allow_unconfirmed_access_for= instead."
Devise.allow_unconfirmed_access_for = value
end
def self.stateless_token=(value)
puts "\n[DEVISE] Devise.stateless_token= is deprecated. Please append :token_auth to Devise.skip_session_storage " \
warn "\n[DEVISE] Devise.stateless_token= is deprecated. Please append :token_auth to Devise.skip_session_storage " \
"instead, for example: Devise.skip_session_storage << :token_auth"
Devise.skip_session_storage << :token_auth
end

View file

@ -69,12 +69,12 @@ module Devise
end
def rememberable_value
if respond_to?(:authenticatable_salt) && (salt = authenticatable_salt)
if salt = authenticatable_salt
salt
else
raise "The #{self.class.name} class does not respond to remember_token and " <<
"authenticatable_salt returns nil. In order to use rememberable, you must " <<
"add a remember_token field to your model or ensure a password is always set."
raise "authenticable_salt returned nil for the #{self.class.name} model. " \
"In order to use rememberable, you must ensure a password is always set " \
"or implement rememberable_value in your model with your own logic."
end
end

View file

@ -27,9 +27,9 @@ module Devise
# Tell how to apply schema methods.
def apply_devise_schema(name, type, options={})
@__devise_warning_raised ||= begin
ActiveSupport::Deprecation.warn "You are using t.database_authenticatable and others in your migration " \
"and this feature is deprecated. Please simply use Rails helpers instead as mentioned here: " \
"https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style"
$stderr.puts "\n[DEVISE] You are using t.database_authenticatable and others in your migration " \
"and this feature is deprecated. Please simply use Rails helpers instead as mentioned here:\n" \
"https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style\n\n"
true
end
column name, type.to_s.downcase.to_sym, options

View file

@ -44,14 +44,14 @@ module Devise
initializer "devise.deprecations" do
if Devise.case_insensitive_keys == false
puts "\n[DEVISE] Devise.case_insensitive_keys is false which is no longer " \
warn "\n[DEVISE] Devise.case_insensitive_keys is false which is no longer " \
"supported. If you want to continue running on this mode, please ensure " \
"you are not using validatable (you can copy the validations directly to your model) " \
"and set case_insensitive_keys to an empty array."
end
if Devise.apply_schema && defined?(Mongoid)
puts "\n[DEVISE] Devise.apply_schema is true. This means Devise was " \
warn "\n[DEVISE] Devise.apply_schema is true. This means Devise was " \
"automatically configuring your DB. This no longer happens. You should " \
"set Devise.apply_schema to false and manually set the fields used by Devise as shown here: " \
"https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style"
@ -59,13 +59,13 @@ module Devise
# TODO: Deprecate the true value of this option as well
if Devise.use_salt_as_remember_token == false
puts "\n[DEVISE] Devise.use_salt_as_remember_token is false which is no longer " \
warn "\n[DEVISE] Devise.use_salt_as_remember_token is false which is no longer " \
"supported. Devise now only uses the salt as remember token and the remember_token " \
"column can be removed from your models."
end
if Devise.reset_password_within.nil?
puts "\n[DEVISE] Devise.reset_password_within is nil. Please set this value to " \
warn "\n[DEVISE] Devise.reset_password_within is nil. Please set this value to " \
"an interval (for example, 6.hours) and add a reset_password_sent_at field to " \
"your Devise models (if they don't have one already)."
end