class PostThumbnailAttachmentBuilder def self.build thumbnail:, thumbnail_base: if thumbnail_base.present? return Post.remote_thumbnail_attachment(thumbnail_base) end return nil if thumbnail.blank? Post.resized_thumbnail_attachment(thumbnail) end end