DEV: Replace custom Onebox blank implementation with ActiveSupport (#23827)

We have a custom implementation of #blank? in our Onebox helpers. This is likely a legacy from when Onebox was a standalone gem. This change replaces all usages with respective incarnations of #blank?, #present?, and #presence from ActiveSupport. It changes a bunch of "unless blank" to "if present" as well.
This commit is contained in:
Ted Johansson
2023-10-07 19:54:26 +02:00
committed by GitHub
parent 85c6914f80
commit 60e624e768
15 changed files with 42 additions and 77 deletions

View File

@ -25,8 +25,7 @@ module Onebox
HTML
else
html = Onebox::Engine::AllowlistedGenericOnebox.new(@url, @timeout).to_html
return if Onebox::Helpers.blank?(html)
html
html.presence
end
end
end