aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-04-12 10:13:29 -0400
committerGitHub <noreply@github.com>2019-04-12 10:13:29 -0400
commit713f62430a42294dcb156cc8f38b41509a60d7a6 (patch)
treeeea37beb3f15066ed58eb0068c309dd0571231a6
parentef0c5fe0d98ad1b1b27fe3d6d19ae62aed3e8aa1 (diff)
parentf999210c98d216c8c7aef3da60820a041c4e96f1 (diff)
downloadrails-713f62430a42294dcb156cc8f38b41509a60d7a6.tar.gz
rails-713f62430a42294dcb156cc8f38b41509a60d7a6.tar.bz2
rails-713f62430a42294dcb156cc8f38b41509a60d7a6.zip
Merge pull request #35952 from utilum/instance_var
Squash `warning: instance variable @filename not initialized`
-rw-r--r--actionview/lib/action_view/template/handlers/erb/erubi.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/template/handlers/erb/erubi.rb b/actionview/lib/action_view/template/handlers/erb/erubi.rb
index 307b852440..e602aa117a 100644
--- a/actionview/lib/action_view/template/handlers/erb/erubi.rb
+++ b/actionview/lib/action_view/template/handlers/erb/erubi.rb
@@ -25,7 +25,7 @@ module ActionView
src = @src
view = Class.new(ActionView::Base) {
include action_view_erb_handler_context._routes.url_helpers
- class_eval("define_method(:_template) { |local_assigns, output_buffer| #{src} }", @filename || "(erubi)", 0)
+ class_eval("define_method(:_template) { |local_assigns, output_buffer| #{src} }", defined?(@filename) ? @filename : "(erubi)", 0)
}.empty
view._run(:_template, nil, {}, ActionView::OutputBuffer.new)
end