Representations 追加(#241) (#267)

#241

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #267
このコミットはPull リクエスト #267 でマージされました.
このコミットが含まれているのは:
2026-02-22 01:50:56 +09:00
コミット 82302cd3d1
7個のファイルの変更66行の追加32行の削除
+16
ファイルの表示
@@ -0,0 +1,16 @@
# frozen_string_literal: true
module PostRepr
BASE = { include: { tags: TagRepr::BASE } }.freeze
module_function
def base post
post.as_json(BASE)
end
def many posts
posts.map { |p| base(p) }
end
end