This commit is contained in:
2025-05-15 02:21:42 +09:00
parent 137c86bba7
commit 4cf3fc4d8c
12 changed files with 124 additions and 57 deletions
+3
View File
@@ -1,4 +1,7 @@
class Post < ApplicationRecord
belongs_to :parent, class_name: 'Post', optional: true, foreign_key: 'parent_id'
belongs_to :user, foreign_key: ''
has_many :post_tags, dependent: :destroy
has_many :tags, through: :post_tags
has_many :user_post_views, dependent: :destroy
end