Use the custom namespace to find the custom input.

In previous ruby versions(1.9.3) we can not use `Object.get_const('CustomNamespace::MyInput')`,
the correct way is `CustomNamespace.get('MyInput')`.
This commit is contained in:
Ulisses Herrera Freire de Almeida 2014-06-26 14:31:20 -03:00
parent 5ae526ed3c
commit 7dd567ca8c
1 changed files with 1 additions and 3 deletions

View File

@ -623,9 +623,7 @@ module SimpleForm
def attempt_mapping_with_custom_namespace(input_name)
SimpleForm.custom_inputs_namespaces.each do |namespace|
camelized = [namespace, input_name].join("::")
if (mapping = attempt_mapping(camelized, Object))
if (mapping = attempt_mapping(input_name, namespace.constantize))
return mapping
end
end