aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-12-25 12:32:16 +0100
committerJosé Valim <jose.valim@gmail.com>2009-12-26 14:11:04 +0100
commit561885aea28c9422fbdfb2be54220b10d4911973 (patch)
tree963051968b814c6e93e87e12c7baa3a4a916717a /activesupport/lib
parent9a9f97af2815469e6f28dee9b88577251ef1b832 (diff)
downloadrails-561885aea28c9422fbdfb2be54220b10d4911973.tar.gz
rails-561885aea28c9422fbdfb2be54220b10d4911973.tar.bz2
rails-561885aea28c9422fbdfb2be54220b10d4911973.zip
String#<< should work for any object which responds to :to_str, so enable this without the performance hit and make Fixnum safe by default.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb
index 3e6ab0ebd2..ceed90ce79 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -1,3 +1,15 @@
+class Object
+ def html_safe?
+ false
+ end
+end
+
+class Fixnum
+ def html_safe?
+ true
+ end
+end
+
class String
attr_accessor :_rails_html_safe
alias html_safe? _rails_html_safe