1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove unnecessary dup from FormTagHelper#field_id

This was needed when `sanitized_method_name` was a memoised method, but
since 59ca21c011 it's a local variable.
This commit is contained in:
Eugene Kenny 2021-07-14 13:06:05 +01:00
parent f6f250e54b
commit c9cdf7410e

View file

@ -104,7 +104,7 @@ module ActionView
# a little duplication to construct fewer strings
if sanitized_object_name.empty?
sanitized_method_name.dup
sanitized_method_name
elsif suffixes.any?
[sanitized_object_name, index, sanitized_method_name, *suffixes].compact.join("_")
elsif index