Moves minimum_password_length to DeviseController.

This commit is contained in:
Katee
2014-12-16 16:14:32 -05:00
parent 5e12b158d1
commit d0a30d485d
3 changed files with 11 additions and 12 deletions

View File

@@ -23,10 +23,7 @@ class Devise::PasswordsController < DeviseController
# GET /resource/password/edit?reset_password_token=abcdef
def edit
self.resource = resource_class.new
@validatable = devise_mapping.validatable?
if @validatable
@minimum_password_length = resource_class.password_length.min
end
set_minimum_password_length
resource.reset_password_token = params[:reset_password_token]
end

View File

@@ -5,10 +5,7 @@ class Devise::RegistrationsController < DeviseController
# GET /resource/sign_up
def new
build_resource({})
@validatable = devise_mapping.validatable?
if @validatable
@minimum_password_length = resource_class.password_length.min
end
set_minimum_password_length
yield resource if block_given?
respond_with self.resource
end
@@ -31,10 +28,7 @@ class Devise::RegistrationsController < DeviseController
end
else
clean_up_passwords resource
@validatable = devise_mapping.validatable?
if @validatable
@minimum_password_length = resource_class.password_length.min
end
set_minimum_password_length
respond_with resource
end
end

View File

@@ -154,6 +154,14 @@ MESSAGE
end
end
# Sets minimum password length to show to user
def set_minimum_password_length
@validatable = devise_mapping.validatable?
if @validatable
@minimum_password_length = resource_class.password_length.min
end
end
def devise_i18n_options(options)
options
end