-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.3.0 - Custom Inputs Fail to Load #1824
Comments
I seem to be experiencing this issue, but only in |
But downgrade `simple_form`, see heartcombo/simple_form#1824
I'm having the issue in both config/iniitilizers/simple_form.rb # ...
SimpleForm.setup do |config|
# ...setup stuff here..
end
# Added at the bottom of the file
# Explicitly reference the custom input classes
CurrencyInput
CustomInput
MultiValueInput
# End of File Alternatively, it also works to locally override the simple_form/lib/simple_form/form_builder.rb Lines 673 to 681 in 4851758
This works because it always attempts to load the class and raises an error if it's not present. As opposed to the v5.3.0 version which never executes because the lazy loaded class constant isn't loaded, and therefore isn't defined yet: simple_form/lib/simple_form/form_builder.rb Lines 673 to 677 in 8f77f59
|
I use a custom form builder that has custom fields defined in it and this change breaks it too. The intention of the calling method So, for general input types If you do not want this feature, you'd simply set The try catch is used because it is attempting to find a class as the method name implies. If the argument for the change is performance, you'd only see little improvement unless you have a ton of custom inputs. So, to me the change is not really worthwhile and should be reverted. |
This reverts commit b6ae67d, reversing changes made to 0ef4a58. This caused custom inputs to not load properly on non-eager load environments like dev/test, because those constants may not have been defined yet. The previous code would try to constantize them and force-load the lazily-loaded files/constants, the new code breaks that behavior, so we're reverting. Closes #1824, see for more info.
Released v5.3.1 reverting that and trying a slightly different approach to error checking. |
Environment
Current behavior
This commit is a breaking change that prevents custom inputs in
app/input
from being loaded.Expected behavior
Adding the removed snippit returns normal functionality.
The text was updated successfully, but these errors were encountered: