Skip to content

Commit cfa22f1

Browse files
committed
Do not generate dummy string when the tag used is not the <%=
1 parent cab396f commit cfa22f1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

railties/lib/rails/application/dummy_erb_compiler.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ def make_compiler(trim_mode)
1111

1212
class DummyCompiler < ERB::Compiler # :nodoc:
1313
def compile_content(stag, out)
14-
out.push "_erbout << 'dummy_compiler'"
14+
case stag
15+
when '<%='
16+
out.push "_erbout << 'dummy_compiler'"
17+
end
1518
end
1619
end

railties/test/application/rake/dbs_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def db_create_and_drop(expected_database, environment_loaded: true)
5353

5454
test "db:create and db:drop respect environment setting" do
5555
app_file "config/database.yml", <<-YAML
56+
<% 1 %>
5657
development:
5758
database: <%= Rails.application.config.database %>
5859
adapter: sqlite3

0 commit comments

Comments
 (0)