提交 c65f4b1f 编写于 作者: S Santiago Pastorino 提交者: Jeremy Kemper

Making SafeBuffer << an alias for concat method

[#3848 state:committed]
Signed-off-by: NJeremy Kemper <jeremy@bitsweat.net>
上级 293c53ab
......@@ -71,15 +71,12 @@ def concat(value)
super(ERB::Util.h(value))
end
end
alias << concat
def +(other)
dup.concat(other)
end
def <<(value)
self.concat(value)
end
def html_safe?
true
end
......@@ -102,4 +99,4 @@ def html_safe!
def html_safe
ActiveSupport::SafeBuffer.new(self)
end
end
\ No newline at end of file
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册