Do not generate dummy string when the tag used is not the <%=

上级 cab396f4
......@@ -11,6 +11,9 @@ def make_compiler(trim_mode)
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
......@@ -53,6 +53,7 @@ def db_create_and_drop(expected_database, environment_loaded: true)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册