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