mirror of https://github.com/rails/rails
Special case SafeBuffer#concat(nil) to avoid the bulk of deprecations
After trying out https://github.com/rails/rails/pull/42123 it appears that the bulk of the deprecations are for cases such as: ```ruby output << some_helper ``` Where `some_helper` happens to sometime return `nil`. While a regular String would indeed raise a `TypeError` on such case, I wonder if it wouldn't be worth to special case this specific scenario as it is quite harmless and would drastically reduce the amount of deprecated code.
This commit is contained in:
parent
70c5496542
commit
fdb5c0463b
|
@ -184,7 +184,10 @@ module ActiveSupport #:nodoc:
|
|||
end
|
||||
|
||||
def concat(value)
|
||||
super(implicit_html_escape_interpolated_argument(value))
|
||||
unless value.nil?
|
||||
super(implicit_html_escape_interpolated_argument(value))
|
||||
end
|
||||
self
|
||||
end
|
||||
alias << concat
|
||||
|
||||
|
|
Loading…
Reference in New Issue