mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +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:
@ -22,7 +22,7 @@ module Onebox
|
||||
short_type = SHORT_TYPES[match[:endpoint].to_sym]
|
||||
|
||||
description =
|
||||
if Onebox::Helpers.blank?(og_data.description)
|
||||
if og_data.description.blank?
|
||||
"This #{short_type.to_s.chop.capitalize} is private"
|
||||
else
|
||||
Onebox::Helpers.truncate(og_data.description, 250)
|
||||
|
Reference in New Issue
Block a user