lib/formtastic/helpers/input_helper.rb in formtastic-2.3.0.rc3 vs lib/formtastic/helpers/input_helper.rb in formtastic-2.3.0.rc4
- old
+ new
@@ -319,10 +319,12 @@
# input_class(:string) #=> StringInput
# input_class(:awesome) #=> AwesomeInput
def input_class(as)
@input_classes_cache ||= {}
@input_classes_cache[as] ||= begin
- Rails.application.config.cache_classes ? input_class_with_const_defined(as) : input_class_by_trying(as)
+ config = Rails.application.config
+ use_const_defined = config.respond_to?(:eager_load) ? config.eager_load : config.cache_classes
+ use_const_defined ? input_class_with_const_defined(as) : input_class_by_trying(as)
end
end
# prevent exceptions in production environment for better performance
def input_class_with_const_defined(as)