Permalink
Browse files

Merge pull request #1948 from dmathieu/html_safe_numeric

All numerics should be html_safe
  • Loading branch information...
2 parents a1d85a0 + b732724 commit 17693a99ef37ca1444fbc9adb855f3ee49bc3102 @josevalim josevalim committed Jul 3, 2011
@@ -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?

0 comments on commit 17693a9

Please sign in to comment.