mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Promote polymorphic bookmarks to default and migrate (#16729)
This commit migrates all bookmarks to be polymorphic (using the bookmarkable_id and bookmarkable_type) columns. It also deletes all the old code guarded behind the use_polymorphic_bookmarks setting and changes that setting to true for all sites and by default for the sake of plugins. No data is deleted in the migrations, the old post_id and for_topic columns for bookmarks will be dropped later on.
This commit is contained in:
@ -1725,20 +1725,13 @@ class UsersController < ApplicationController
|
||||
end
|
||||
end
|
||||
format.ics do
|
||||
if SiteSetting.use_polymorphic_bookmarks
|
||||
@bookmark_reminders = Bookmark.with_reminders
|
||||
.where(user_id: user.id)
|
||||
.order(:reminder_at)
|
||||
.map do |bookmark|
|
||||
bookmark.registered_bookmarkable.serializer.new(
|
||||
bookmark, scope: user_guardian, root: false
|
||||
)
|
||||
end
|
||||
else
|
||||
@bookmark_reminders = Bookmark.with_reminders
|
||||
.where(user_id: user.id)
|
||||
.includes(:topic)
|
||||
.order(:reminder_at)
|
||||
@bookmark_reminders = Bookmark.with_reminders
|
||||
.where(user_id: user.id)
|
||||
.order(:reminder_at)
|
||||
.map do |bookmark|
|
||||
bookmark.registered_bookmarkable.serializer.new(
|
||||
bookmark, scope: user_guardian, root: false
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user