public
Last active

Fix Formtastic to work with Spring

  • Download Gist
formtastic_spring_patch.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13
diff --git a/lib/formtastic/helpers/input_helper.rb b/lib/formtastic/helpers/input_helper.rb
index 7744dfe..fc04564 100644
--- a/lib/formtastic/helpers/input_helper.rb
+++ b/lib/formtastic/helpers/input_helper.rb
@@ -321,7 +321,7 @@ module Formtastic
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)
+ ActiveSupport::Dependencies.mechanism == :load ? input_class_by_trying(as) : input_class_with_const_defined(as)
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.