mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Bookmark cleanup (#16899)
Gets rid of old bookmark app event and deletes anything leftover from polymorphic bookmark changeover.
This commit is contained in:
@@ -208,17 +208,9 @@ class Topic < ActiveRecord::Base
|
||||
has_many :category_users, through: :category
|
||||
has_many :posts
|
||||
|
||||
# TODO (martin):
|
||||
#
|
||||
# When we are ready we can add as: :bookmarkable here to use the
|
||||
# polymorphic association.
|
||||
#
|
||||
# At that time we may also want to make another association for example
|
||||
# :topic_bookmarks that get all of the bookmarks for that topic's bookmarkable id
|
||||
# and type, because this one gets all of the post bookmarks.
|
||||
#
|
||||
# Note: We can use Bookmark#for_user_in_topic for this.
|
||||
has_many :bookmarks, through: :posts
|
||||
# NOTE: To get all Post _and_ Topic bookmarks for a topic by user,
|
||||
# use the Bookmark.for_user_in_topic scope.
|
||||
has_many :bookmarks, as: :bookmarkable
|
||||
|
||||
has_many :ordered_posts, -> { order(post_number: :asc) }, class_name: "Post"
|
||||
has_many :topic_allowed_users
|
||||
|
||||
Reference in New Issue
Block a user