mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 19:44:39 +08:00
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:
@ -564,7 +564,7 @@ describe PostsController do
|
||||
|
||||
describe "#destroy_bookmark" do
|
||||
fab!(:post) { Fabricate(:post) }
|
||||
fab!(:bookmark) { Fabricate(:bookmark, user: user, post: post, topic: post.topic) }
|
||||
fab!(:bookmark) { Fabricate(:bookmark, user: user, post: post) }
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
@ -578,7 +578,7 @@ describe PostsController do
|
||||
|
||||
context "when the user still has bookmarks in the topic" do
|
||||
before do
|
||||
Fabricate(:bookmark, user: user, post: Fabricate(:post, topic: post.topic), topic: post.topic)
|
||||
Fabricate(:bookmark, user: user, post: Fabricate(:post, topic: post.topic))
|
||||
end
|
||||
it "marks topic_bookmarked as true" do
|
||||
delete "/posts/#{post.id}/bookmark.json"
|
||||
|
Reference in New Issue
Block a user