aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/output_safety.rb
diff options
context:
space:
mode:
authorRichard Monette <richard.monette@shopify.com>2019-03-13 18:28:43 -0400
committerRichard Monette <richard.monette@shopify.com>2019-03-13 19:22:04 -0400
commitaf2052295488fcd3dda88ef11ebd211cf777305f (patch)
treee423d0b8ab38de9a9c0103fb75ca60fe2adaa0d6 /activesupport/lib/active_support/core_ext/string/output_safety.rb
parenta783e4171241480324be575259de32a49d59405d (diff)
downloadrails-af2052295488fcd3dda88ef11ebd211cf777305f.tar.gz
rails-af2052295488fcd3dda88ef11ebd211cf777305f.tar.bz2
rails-af2052295488fcd3dda88ef11ebd211cf777305f.zip
support slice assignment on SafeBuffer
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.rb8
1 files changed, 6 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 3a80de4617..0b40c3d799 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -199,8 +199,12 @@ module ActiveSupport #:nodoc:
super(html_escape_interpolated_argument(value))
end
- def []=(index, value)
- super(index, html_escape_interpolated_argument(value))
+ def []=(*args)
+ if args.count == 3
+ super(args[0], args[1], html_escape_interpolated_argument(args[2]))
+ else
+ super(args[0], html_escape_interpolated_argument(args[1]))
+ end
end
def +(other)