discourse/spec/fabricators/moved_post_fabricator.rb
Mark VanLandingham 9b8af0ea9f
DEV: Create permanent version of moved_posts table from PostMover class (#29664)
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.
2024-11-12 14:35:20 -06:00

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