mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 20:33:38 +08:00
fcc2e7ebbf
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.
24 lines
536 B
Ruby
24 lines
536 B
Ruby
# frozen_string_literal: true
|
|
|
|
Fabricator(:bookmark) do
|
|
user
|
|
name "This looked interesting"
|
|
reminder_at { 1.day.from_now.iso8601 }
|
|
reminder_set_at { Time.zone.now }
|
|
bookmarkable { Fabricate(:post) }
|
|
end
|
|
|
|
Fabricator(:bookmark_next_business_day_reminder, from: :bookmark) do
|
|
reminder_at do
|
|
date = if Time.zone.now.friday?
|
|
Time.zone.now + 3.days
|
|
elsif Time.zone.now.saturday?
|
|
Time.zone.now + 2.days
|
|
else
|
|
Time.zone.now + 1.day
|
|
end
|
|
date.iso8601
|
|
end
|
|
reminder_set_at { Time.zone.now }
|
|
end
|