feat: 投稿とタグのリレーション・テーブルについて論理削除と履歴を追加(#84) #148

マージ済み
みてるぞ が 5 個のコミットを feature/084 から main へマージ 2025-12-13 16:34:47 +09:00
コミット 851eb04e14 の変更だけを表示してゐます - すべてのコミットを表示
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ class Post < ApplicationRecord
belongs_to :parent, class_name: 'Post', optional: true, foreign_key: 'parent_id'
belongs_to :uploaded_user, class_name: 'User', optional: true
has_many :post_tags, dependent: :delete_all, inverse_of: :post
has_many :post_tags, dependent: :destroy, inverse_of: :post
has_many :active_post_tags, -> { kept }, class_name: 'PostTag', inverse_of: :post
has_many :post_tags_with_discarded, -> { with_discarded }, class_name: 'PostTag'
has_many :tags, through: :active_post_tags