このコミットが含まれているのは:
2025-05-21 01:16:40 +09:00
コミット 59678cf8b9
7個のファイルの変更75行の追加4行の削除
+8
ファイルの表示
@@ -4,4 +4,12 @@ class Post < ApplicationRecord
has_many :post_tags, dependent: :destroy
has_many :tags, through: :post_tags
has_many :user_post_views, dependent: :destroy
has_one_attached :thumbnail
def as_json options = { }
super(options).merge({ thumbnail: thumbnail.attached? ?
Rails.application.routes.url_helpers.rails_blob_url(
thumbnail, only_path: false) :
nil })
end
end