From 63daf6b317e7b491fe631b42fcea497baacb5dea Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 28 Jul 2025 04:40:37 -0400 Subject: [PATCH] Fix `Style/GuardClause` in `PreviewCard` (#35525) --- app/models/preview_card.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/preview_card.rb b/app/models/preview_card.rb index 56fe4836355..8e0e13cdb94 100644 --- a/app/models/preview_card.rb +++ b/app/models/preview_card.rb @@ -170,10 +170,9 @@ class PreviewCard < ApplicationRecord private def serialized_authors - if author_name? || author_url? || author_account_id? - PreviewCard::Author - .new(self) - end + return unless author_name? || author_url? || author_account_id? + + PreviewCard::Author.new(self) end def extract_dimensions