提交 b7327241 编写于 作者: D Damien Mathieu

all numerics should be html_safe - Closes #1935

上级 a1d85a03
......@@ -67,7 +67,7 @@ def html_safe?
end
end
class Fixnum
class Numeric
def html_safe?
true
end
......
......@@ -353,6 +353,10 @@ def to_s
test "A fixnum is safe by default" do
assert 5.html_safe?
end
test "a float is safe by default" do
assert 5.7.html_safe?
end
test "An object is unsafe by default" do
assert !@object.html_safe?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册