diff options
author | Akira Matsuda <ronnie@dio.jp> | 2017-09-01 17:43:11 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2017-09-01 17:43:11 +0900 |
commit | 61f92f8bc5fa0b486fc56f249fa23f1102e79759 (patch) | |
tree | 657b66abc3073ced85d7be2f91ab968bd8c5f961 /actionview/lib | |
parent | 2d2f1aa393442e656501e0c3c99f7879d4e180b6 (diff) | |
download | rails-61f92f8bc5fa0b486fc56f249fa23f1102e79759.tar.gz rails-61f92f8bc5fa0b486fc56f249fa23f1102e79759.tar.bz2 rails-61f92f8bc5fa0b486fc56f249fa23f1102e79759.zip |
double assign is no longer an effective workaround for unused variable warning
`def a() x = x = 1; end` warns since Ruby 2.5 (r59585)
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/template.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index e53c8356af..1d0797276f 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -331,7 +331,7 @@ module ActionView locals = locals.grep(/\A@?(?![A-Z0-9])(?:[[:alnum:]_]|[^\0-\177])+\z/) # Double assign to suppress the dreaded 'assigned but unused variable' warning - locals.each_with_object("".dup) { |key, code| code << "#{key} = #{key} = local_assigns[:#{key}];" } + locals.each_with_object("".dup) { |key, code| code << "#{key} = local_assigns[:#{key}]; #{key} = #{key};" } end def method_name |