Skip to content

Commit 5c0d9a5

Browse files
author
James McKinney
committed
Copy Formtastic 2.1.1's #input_class in case user has Formtastic 2.2
1 parent eaf18a4 commit 5c0d9a5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/active_admin/form_builder.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ def active_admin_input_class_name(as)
125125
"ActiveAdmin::Inputs::#{as.to_s.camelize}Input"
126126
end
127127

128+
# Copy Formtastic 2.1.1's #input_class in case user has Formtastic 2.2
129+
def input_class(as)
130+
@input_classes_cache ||= {}
131+
@input_classes_cache[as] ||= begin
132+
Rails.application.config.cache_classes ? input_class_with_const_defined(as) : input_class_by_trying(as)
133+
end
134+
end
135+
128136
# prevent exceptions in production environment for better performance
129137
def input_class_with_const_defined(as)
130138
input_class_name = custom_input_class_name(as)

0 commit comments

Comments
 (0)