DEV: Ignore bookmarks.topic_id column and remove references to it in code (#14289)

We don't need no stinkin' denormalization! This commit ignores
the topic_id column on bookmarks, to be deleted at a later date.
We don't really need this column and it's better to rely on the
post.topic_id as the canonical topic_id for bookmarks, then we
don't need to remember to update both columns if the bookmarked
post moves to another topic.
This commit is contained in:
Martin Brennan
2021-09-15 10:16:54 +10:00
committed by GitHub
parent d99735e24d
commit 22208836c5
27 changed files with 250 additions and 92 deletions

View File

@ -1598,7 +1598,10 @@ class UsersController < ApplicationController
end
end
format.ics do
@bookmark_reminders = Bookmark.where(user_id: user.id).where.not(reminder_at: nil).joins(:topic)
@bookmark_reminders = Bookmark.with_reminders
.where(user_id: user.id)
.includes(:topic)
.order(:reminder_at)
end
end
end