feat: 投稿とタグのリレーション・テーブルについて論理削除と履歴を追加(#84) (#148)
#84 マイグレ修正 Merge remote-tracking branch 'origin/main' into feature/084 #84 構文エラー修正 #84 #84 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #148
This commit was merged in pull request #148.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
require 'mini_magick'
|
||||
|
||||
|
||||
class Post < ApplicationRecord
|
||||
require 'mini_magick'
|
||||
|
||||
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: :destroy
|
||||
has_many :tags, through: :post_tags
|
||||
|
||||
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
|
||||
has_many :user_post_views, dependent: :destroy
|
||||
has_many :post_similarities_as_post,
|
||||
class_name: 'PostSimilarity',
|
||||
|
||||
Reference in New Issue
Block a user