aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/output_safety.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-03-11 17:32:26 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-11 17:43:29 -0800
commit47bc138fc1d9ddafab8e4cf9cac8865f2092c003 (patch)
tree65fb223886d6eeb8bc364971d13050a6f1252cca /activesupport/lib/active_support/core_ext/string/output_safety.rb
parent1f6c5677ad18a2d49866100b043b82bd030875d4 (diff)
downloadrails-47bc138fc1d9ddafab8e4cf9cac8865f2092c003.tar.gz
rails-47bc138fc1d9ddafab8e4cf9cac8865f2092c003.tar.bz2
rails-47bc138fc1d9ddafab8e4cf9cac8865f2092c003.zip
Write strings to fragment cache, not outputbuffers
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string/output_safety.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb6
1 files changed, 5 insertions, 1 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 c55b471986..3a49cd288b 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -89,8 +89,12 @@ module ActiveSupport #:nodoc:
self
end
+ def as_str
+ ''.replace(self)
+ end
+
def to_yaml
- "".replace(self).to_yaml
+ as_str.to_yaml
end
end
end