aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2016-11-02 16:13:26 +0000
committerAndrew White <andrew.white@unboxed.co>2016-11-02 16:15:01 +0000
commitb12b4be0b8070a0e16f7ab0125c4f0aec1766bcc (patch)
treea51234f3453453e75bf30a8de57d747582f92b37
parent2b1ec283d41898cbe1e2f60f72ed40ebc0d2672a (diff)
downloadrails-b12b4be0b8070a0e16f7ab0125c4f0aec1766bcc.tar.gz
rails-b12b4be0b8070a0e16f7ab0125c4f0aec1766bcc.tar.bz2
rails-b12b4be0b8070a0e16f7ab0125c4f0aec1766bcc.zip
Double assign locals to avoid unused variables warning
-rw-r--r--actionpack/lib/action_view/template.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index e67e52cc76..069ac4e761 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -323,7 +323,8 @@ module ActionView
end
def locals_code #:nodoc:
- @locals.map { |key| "#{key} = local_assigns[:#{key}];" }.join
+ # Double assign to suppress the dreaded 'assigned but unused variable' warning
+ @locals.map { |key| "#{key} = #{key} = local_assigns[:#{key}];" }.join
end
def method_name #:nodoc: