diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-12-28 21:56:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-28 21:56:06 -0500 |
commit | 17ef58db1776a795c9f9e31a1634db7bcdc3ecdf (patch) | |
tree | 733043f71e430c070316382cc84e75c481dae7bd /actionview/lib/action_view | |
parent | 010e246756c09f44e901f4fd8e8eab2cb3022e95 (diff) | |
parent | ebeeceeb2aa34d33337f991607debae715ca061a (diff) | |
download | rails-17ef58db1776a795c9f9e31a1634db7bcdc3ecdf.tar.gz rails-17ef58db1776a795c9f9e31a1634db7bcdc3ecdf.tar.bz2 rails-17ef58db1776a795c9f9e31a1634db7bcdc3ecdf.zip |
Merge pull request #27463 from y-yagi/fix_26931
do not mutate `object_name` of class in `fields_for`
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/form_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index a66a56d441..26a625e4fe 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -1924,10 +1924,11 @@ module ActionView record_name = model_name_from_record_or_class(record_object).param_key end + object_name = @object_name index = if options.has_key?(:index) options[:index] elsif defined?(@auto_index) - self.object_name = @object_name.to_s.sub(/\[\]$/, "") + object_name = object_name.to_s.sub(/\[\]$/, "") @auto_index end |