From cfa22f1a4b5e8b95ee01a432168de2f831b3f788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 11 Mar 2019 17:49:27 -0400 Subject: [PATCH] Do not generate dummy string when the tag used is not the <%= --- railties/lib/rails/application/dummy_erb_compiler.rb | 5 ++++- railties/test/application/rake/dbs_test.rb | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/railties/lib/rails/application/dummy_erb_compiler.rb b/railties/lib/rails/application/dummy_erb_compiler.rb index 4e92526969..985e6f605e 100644 --- a/railties/lib/rails/application/dummy_erb_compiler.rb +++ b/railties/lib/rails/application/dummy_erb_compiler.rb @@ -11,6 +11,9 @@ end class DummyCompiler < ERB::Compiler # :nodoc: def compile_content(stag, out) - out.push "_erbout << 'dummy_compiler'" + case stag + when '<%=' + out.push "_erbout << 'dummy_compiler'" + end end end diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 4f689bcb78..ea7117800c 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -53,6 +53,7 @@ module ApplicationTests test "db:create and db:drop respect environment setting" do app_file "config/database.yml", <<-YAML + <% 1 %> development: database: <%= Rails.application.config.database %> adapter: sqlite3