|
@@ -4,7 +4,7 @@ class Post < ApplicationRecord |
|
|
belongs_to :parent, class_name: 'Post', optional: true, foreign_key: 'parent_id' |
|
|
belongs_to :parent, class_name: 'Post', optional: true, foreign_key: 'parent_id' |
|
|
belongs_to :uploaded_user, class_name: 'User', optional: true |
|
|
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 :active_post_tags, -> { kept }, class_name: 'PostTag', inverse_of: :post |
|
|
has_many :post_tags_with_discarded, -> { with_discarded }, class_name: 'PostTag' |
|
|
has_many :post_tags_with_discarded, -> { with_discarded }, class_name: 'PostTag' |
|
|
has_many :tags, through: :active_post_tags |
|
|
has_many :tags, through: :active_post_tags |
|
|