mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 11:43:41 +08:00
9b8af0ea9f
This is a very simple change, which creates a permanent table in the DB, rather than generating a temporary table when moving posts. This change is about capturing data and any usage will appear in a follow-up. I did include a new column created_new_topic in the new table, so that it can be easily audited without having to compare destination topic created_at with moved_post records.
16 lines
459 B
Ruby
16 lines
459 B
Ruby
# frozen_string_literal: true
|
|
|
|
Fabricator(:moved_post) do
|
|
created_new_topic false
|
|
new_topic { Fabricate(:topic) }
|
|
new_post { Fabricate(:post) }
|
|
old_topic { Fabricate(:topic) }
|
|
old_post { Fabricate(:post) }
|
|
|
|
after_build do |moved_post, transients|
|
|
moved_post.new_topic_title = moved_post.new_topic.title
|
|
moved_post.new_post_number = moved_post.new_post.post_number
|
|
moved_post.old_post_number = moved_post.old_post.post_number
|
|
end
|
|
end
|