Fix Style/GuardClause in app/helpers (#35526)

This commit is contained in:
Matt Jankowski 2025-07-28 04:40:20 -04:00 committed by GitHub
parent 2acc942bb4
commit e183d7dd9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 23 deletions

View File

@ -65,13 +65,13 @@ module FormattingHelper
end
def rss_content_preroll(status)
if status.spoiler_text?
return unless status.spoiler_text?
safe_join [
tag.p { spoiler_with_warning(status) },
tag.hr,
]
end
end
def spoiler_with_warning(status)
safe_join [
@ -81,12 +81,12 @@ module FormattingHelper
end
def rss_content_postroll(status)
if status.preloadable_poll
return unless status.preloadable_poll
tag.p do
poll_option_tags(status)
end
end
end
def poll_option_tags(status)
safe_join(

View File

@ -24,7 +24,8 @@ module ThemeHelper
end
def custom_stylesheet
if active_custom_stylesheet.present?
return if active_custom_stylesheet.blank?
stylesheet_link_tag(
custom_css_path(active_custom_stylesheet),
host: root_url,
@ -32,17 +33,16 @@ module ThemeHelper
skip_pipeline: true
)
end
end
private
def active_custom_stylesheet
if cached_custom_css_digest.present?
return if cached_custom_css_digest.blank?
[:custom, cached_custom_css_digest.to_s.first(8)]
.compact_blank
.join('-')
end
end
def cached_custom_css_digest
Rails.cache.fetch(:setting_digest_custom_css) do