1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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?