このコミットが含まれているのは:
@@ -7,20 +7,13 @@ module PostCompactRepr
|
||||
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 ActionController::UrlGenerationError, ArgumentError, URI::InvalidURIError
|
||||
nil
|
||||
PostRepr
|
||||
.common(post)
|
||||
.slice(
|
||||
'id',
|
||||
'title',
|
||||
'url',
|
||||
'thumbnail',
|
||||
'thumbnail_base')
|
||||
end
|
||||
end
|
||||
|
||||
新しい課題から参照
ユーザをブロックする