mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 06:28:04 +08:00
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:
@ -17,7 +17,7 @@ module Onebox
|
||||
|
||||
def placeholder_html
|
||||
oembed = get_oembed
|
||||
return if Onebox::Helpers.blank?(oembed.thumbnail_url)
|
||||
return if oembed.thumbnail_url.blank?
|
||||
"<img src='#{oembed.thumbnail_url}' #{oembed.title_attr}>"
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user