Fix social image order logic (#2645)

This commit is contained in:
Ben Halpern 2019-05-01 18:47:10 -04:00 committed by GitHub
parent 5890542f01
commit 7100eab636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,8 +14,6 @@ module SocialImageHelper
end
def article_social_image_url(article)
return legacy_article_social_image(article) unless use_new_social_url?(article)
if (image = article.social_image || article.main_image || article.video_thumbnail_url)
return cl_image_path(image,
type: "fetch",
@ -27,7 +25,7 @@ module SocialImageHelper
fetch_format: "auto",
sign_url: true)
end
return legacy_article_social_image(article) unless use_new_social_url?(article)
article_social_preview_url(article, format: :png)
end