mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 02:04:53 +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:
@ -1482,21 +1482,9 @@ describe Search do
|
||||
|
||||
it "can filter by posts in the user's bookmarks" do
|
||||
expect(search_with_bookmarks.posts.map(&:id)).to eq([])
|
||||
Fabricate(:bookmark, user: user, post: bookmark_post1)
|
||||
bm = Fabricate(:bookmark, user: user, bookmarkable: bookmark_post1)
|
||||
expect(search_with_bookmarks.posts.map(&:id)).to match_array([bookmark_post1.id])
|
||||
end
|
||||
|
||||
context "using polymorphic bookmarks" do
|
||||
before do
|
||||
SiteSetting.use_polymorphic_bookmarks = true
|
||||
end
|
||||
|
||||
it "can filter by posts in the user's bookmarks" do
|
||||
expect(search_with_bookmarks.posts.map(&:id)).to eq([])
|
||||
bm = Fabricate(:bookmark, user: user, bookmarkable: bookmark_post1)
|
||||
expect(search_with_bookmarks.posts.map(&:id)).to match_array([bookmark_post1.id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'supports pinned' do
|
||||
|
Reference in New Issue
Block a user