diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-29 10:32:24 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-29 10:32:24 -0700 |
commit | 3e8fe1d8984b78e47ec0702687b14eba13dc486e (patch) | |
tree | 418a3b25da0ac251edf89876283a252821ba1dcf /activesupport/lib | |
parent | bbe1b1afcef0813883d80e60a0d9dd93f778e6e2 (diff) | |
parent | 6ef1079e0ed093e54a0e1dc9cb3b97d5e1330caf (diff) | |
download | rails-3e8fe1d8984b78e47ec0702687b14eba13dc486e.tar.gz rails-3e8fe1d8984b78e47ec0702687b14eba13dc486e.tar.bz2 rails-3e8fe1d8984b78e47ec0702687b14eba13dc486e.zip |
Merge pull request #2344 from bcardarella/resolve_warning_for_capture_helper_test
Reset @dirty to false when slicing an instance of SafeBuffer
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 6 |
1 files changed, 6 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 3bf4edbdef..6d6c4912bb 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -86,6 +86,12 @@ module ActiveSupport #:nodoc: end end + def[](*args) + new_safe_buffer = super + new_safe_buffer.instance_eval { @dirty = false } + new_safe_buffer + end + def safe_concat(value) raise SafeConcatError if dirty? original_concat(value) |