From 37c3e67ae6dbf2750fa964de3a38c905203044c3 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 6 Oct 2023 01:35:08 +0200 Subject: [PATCH] Splat builder that works with ActionView::OutputBuffer This sketch of "have it work with Rails 7.1" for my app, it reacts to the fact that OutputBuffer no longer derives from String. --- lib/slim/splat/builder.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/slim/splat/builder.rb b/lib/slim/splat/builder.rb index 84ecdc99..efbecb59 100644 --- a/lib/slim/splat/builder.rb +++ b/lib/slim/splat/builder.rb @@ -35,7 +35,11 @@ def attr(name, value) end if @attrs[name] if delim = @options[:merge_attrs][name] - @attrs[name] += delim + value.to_s + if @attrs[name].respond_to?(:+) + @attrs[name] += delim + value.to_s + else + @attrs[name] << delim + value.to_s + end else raise("Multiple #{name} attributes specified") end