Browse files

all numerics should be html_safe - Closes #1935

  • Loading branch information...
1 parent a1d85a0 commit b7327241aa01d570817edd2274d48ffd9451ddcd @dmathieu dmathieu committed Jul 3, 2011
View
2 activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -67,7 +67,7 @@ def html_safe?
end
end
-class Fixnum
+class Numeric
def html_safe?
true
end
View
4 activesupport/test/core_ext/string_ext_test.rb
@@ -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?

0 comments on commit b732724

Please sign in to comment.