Skip to content

Commit abdcbae

Browse files
committed
Use only one batch to generated form selectors
This commit fixes the generation of form helpers by using one CodeGenerator instance instead of 17
1 parent cf976b0 commit abdcbae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

actionview/lib/action_view/helpers/form_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,8 +2020,8 @@ def field_name(method, *methods, multiple: false, index: @options[:index])
20202020
#
20212021
# Please refer to the documentation of the base helper for details.
20222022

2023-
(field_helpers - [:label, :checkbox, :radio_button, :fields_for, :fields, :hidden_field, :file_field]).each do |selector|
2024-
ActiveSupport::CodeGenerator.batch(self, __FILE__, __LINE__) do |code_generator|
2023+
ActiveSupport::CodeGenerator.batch(self, __FILE__, __LINE__) do |code_generator|
2024+
(field_helpers - [:label, :checkbox, :radio_button, :fields_for, :fields, :hidden_field, :file_field]).each do |selector|
20252025
code_generator.class_eval do |batch|
20262026
batch <<
20272027
"def #{selector}(method, options = {})" <<

0 commit comments

Comments
 (0)