mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Cache constant on check fields
This commit is contained in:
parent
6b363d6af9
commit
8bcb05d6c0
1 changed files with 4 additions and 2 deletions
|
@ -54,8 +54,10 @@ module Devise
|
||||||
instance = klass.new
|
instance = klass.new
|
||||||
|
|
||||||
klass.devise_modules.each do |mod|
|
klass.devise_modules.each do |mod|
|
||||||
if const_get(mod.to_s.classify).respond_to?(:required_fields)
|
constant = const_get(mod.to_s.classify)
|
||||||
const_get(mod.to_s.classify).required_fields(klass).each do |field|
|
|
||||||
|
if constant.respond_to?(:required_fields)
|
||||||
|
constant.required_fields(klass).each do |field|
|
||||||
failed_attributes << field unless instance.respond_to?(field)
|
failed_attributes << field unless instance.respond_to?(field)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue