-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up nested #simple_fields_for usage by a considerable amount
Exceptions are slow due to generating backtraces - and then when other debugging gems (such as did_you mean, which are included with Ruby and Rails these days) get involved it resulted in excessive Object allocation.
- Loading branch information
Showing
1 changed file
with
1 addition
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
terryyin
|
||
return at.const_get(mapping) if at.const_defined?(mapping) | ||
end | ||
|
||
def attempt_mapping_with_custom_namespace(input_name) | ||
|
Just upgraded from 5.1.0 to 5.3.0 on Rails 5.2 (I know, it is a work in progress.)
Removing this prevents loading of custom inputs in app/inputs