-
Notifications
You must be signed in to change notification settings - Fork 358
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
Prepend ActionView::Helpers::NumberHelper with our NumberHelper #9119
base: master
Are you sure you want to change the base?
Conversation
6fb3118
to
b33d86c
Compare
b33d86c
to
6712f2c
Compare
Checked commit jrafanie@6712f2c with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
@@ -10,7 +10,7 @@ module ApplicationHelper | |||
include StiRoutingHelper | |||
include ToolbarHelper | |||
include TextualSummaryHelper | |||
include NumberHelper | |||
ActionView::Helpers::NumberHelper.prepend NumberHelper # override rails number helper with our needs for number_to_human_size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we included the rails number helper first in the controller...
then, we included ours in the application helper which was then included in the controller.
This change ensures we prepend our NumberHelper on the rails ones and do it directly in the application helper to ensure we're not including the original one directly.
This ensures we prepend our NumberHelper into the existing helper. Previously, there was a loading order problem where the original rails NumberHelper would be used.
For rails 7, this load order was causing these types of errors where the original number helper was being used: