1
0
Fork 0
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:
Carlos Antonio da Silva 2012-05-15 15:18:53 -03:00
parent 6b363d6af9
commit 8bcb05d6c0

View file

@ -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