Skip to content

Commit

Permalink
Merge pull request #1810 from meanphil/mappings-slow-exception
Browse files Browse the repository at this point in the history
Speed up nested #simple_fields_for usage by a considerable amount

Closes #1725 
Closes #1791 
Closes #1790
  • Loading branch information
carlosantoniodasilva authored Feb 20, 2023
2 parents 0ef4a58 + ff3903f commit b6ae67d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/simple_form/form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,7 @@ def mapping_override(klass)

def attempt_mapping(mapping, at)
return if SimpleForm.inputs_discovery == false && at == Object

begin
at.const_get(mapping)
rescue NameError => e
raise if e.message !~ /#{mapping}$/
end
return at.const_get(mapping) if at.const_defined?(mapping)
end

def attempt_mapping_with_custom_namespace(input_name)
Expand Down

0 comments on commit b6ae67d

Please sign in to comment.