all numerics should be html_safe - Closes #1935

This commit is contained in:
Damien Mathieu
2011-07-03 13:09:28 +02:00
parent a1d85a03bd
commit b7327241aa
2 changed files with 5 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ class Object
end
end
class Fixnum
class Numeric
def html_safe?
true
end

View File

@@ -353,6 +353,10 @@ class OutputSafetyTest < ActiveSupport::TestCase
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?