aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-06-22 06:30:56 -0700
committerXavier Noria <fxn@hashref.com>2011-06-22 06:30:56 -0700
commit5654f6870af3cfb7dd92a017e7f86ba40ebfd9bf (patch)
treecd292c5754c6e67969612d691471b69a7bda6e4a /activesupport/lib/active_support/core_ext
parent53444b861c6e12ce77d6dfa2cd3031979c2d83fa (diff)
parent9fadf385d892931190b465b691ecef796f0eea5c (diff)
downloadrails-5654f6870af3cfb7dd92a017e7f86ba40ebfd9bf.tar.gz
rails-5654f6870af3cfb7dd92a017e7f86ba40ebfd9bf.tar.bz2
rails-5654f6870af3cfb7dd92a017e7f86ba40ebfd9bf.zip
Merge pull request #1750 from dmathieu/non_string_methods
Calling unsafe methods which don't return a string shouldn't fail
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb4
1 files changed, 2 insertions, 2 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 71f3879e49..a19b5c95c7 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -137,8 +137,8 @@ module ActiveSupport #:nodoc:
UNSAFE_STRING_METHODS.each do |unsafe_method|
class_eval <<-EOT, __FILE__, __LINE__
- def #{unsafe_method}(*args)
- super.to_str
+ def #{unsafe_method}(*args, &block)
+ to_str.#{unsafe_method}(*args, &block)
end
def #{unsafe_method}!(*args)