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:
parent
a1d85a03bd
commit
b7327241aa
2 changed files with 5 additions and 1 deletions
|
@ -67,7 +67,7 @@ class Object
|
|||
end
|
||||
end
|
||||
|
||||
class Fixnum
|
||||
class Numeric
|
||||
def html_safe?
|
||||
true
|
||||
end
|
||||
|
|
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue