このコミットが含まれているのは:
2026-07-17 23:14:37 +09:00
コミット 0ae41b6266
19個のファイルの変更455行の追加216行の削除
+26
ファイルの表示
@@ -0,0 +1,26 @@
# frozen_string_literal: true
module PostCompactRepr
module_function
def base post
return nil if post.nil?
{
id: post.id,
title: post.title,
url: post.url,
thumbnail_url: thumbnail_url(post) }
end
def thumbnail_url post
return nil unless post.thumbnail.attached?
Rails.application.routes.url_helpers.rails_storage_proxy_url(
post.thumbnail,
only_path: false)
rescue
nil
end
end