mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +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:
@ -249,13 +249,6 @@ describe DiscourseNarrativeBot::NewUserNarrative do
|
||||
end
|
||||
|
||||
it 'adds an after commit model callback to bookmark' do
|
||||
Jobs.run_later!
|
||||
bookmark = Fabricate(:bookmark, post: Fabricate(:post))
|
||||
expect_job_enqueued(job: :bot_input, args: { user_id: bookmark.user_id, post_id: bookmark.post_id, input: "bookmark" })
|
||||
end
|
||||
|
||||
it 'adds an after commit model callback to bookmark for polymorphic bookmarks (but only for post polymorphic bookmarks)' do
|
||||
SiteSetting.use_polymorphic_bookmarks = true
|
||||
Jobs.run_later!
|
||||
bookmark = Fabricate(:bookmark, bookmarkable: Fabricate(:post))
|
||||
expect_job_enqueued(job: :bot_input, args: { user_id: bookmark.user_id, post_id: bookmark.bookmarkable_id, input: "bookmark" })
|
||||
|
Reference in New Issue
Block a user