A platform for community discussion. Free, open, simple.
Fix the build.
Guo Xiang Tanb068a8a7715d
diff --git a/app/models/post_mover.rb b/app/models/post_mover.rbindex c8813e9a19d..1e18ea3d3e9 100644--- a/app/models/post_mover.rb+++ b/app/models/post_mover.rb@@ -153,7 +153,7 @@ class PostMoverdef move_email_logs(old_post, new_post)EmailLog.where(post_id: old_post.id)- .update_all(topic_id: new_post.topic_id, post_id: new_post.id)+ .update_all(post_id: new_post.id)enddef update_statisticsdiff --git a/spec/models/post_mover_spec.rb b/spec/models/post_mover_spec.rbindex 3379fe44a24..9f8e49778e1 100644--- a/spec/models/post_mover_spec.rb+++ b/spec/models/post_mover_spec.rb@@ -356,22 +356,35 @@ describe PostMover doendit "moves email log entries" do+ old_topic = old_post.topic- skip "@tgxworld to fix"+ 2.times do+ Fabricate(:email_log,+ user: old_post.user,+ post: old_post,+ email_type: :mailing_list+ )+ end- old_topic = old_post.topic- Fabricate(:email_log, user: old_post.user, topic: old_topic, post: old_post, email_type: :mailing_list)- Fabricate(:email_log, user: old_post.user, topic: old_topic, post: old_post, email_type: :mailing_list)- Fabricate(:email_log, user: old_post.user, post: old_post, email_type: :mailing_list)+ some_post = Fabricate(:post)- expect(EmailLog.where(topic_id: old_topic.id, post_id: old_post.id).count).to eq(2)- expect(EmailLog.where(topic_id: nil, post_id: old_post.id).count).to eq(1)+ Fabricate(:email_log,+ user: some_post.user,+ post: some_post,+ email_type: :mailing_list+ )++ expect(EmailLog.where(post_id: old_post.id).count).to eq(2)++ new_topic = old_topic.move_posts(+ user,+ [old_post.id],+ title: "new testing topic name"+ )- new_topic = old_topic.move_posts(user, [old_post.id], title: "new testing topic name")new_post = new_topic.first_post- expect(EmailLog.where(topic_id: old_topic.id, post_id: old_post.id).count).to eq(0)- expect(EmailLog.where(topic_id: new_topic.id, post_id: new_post.id).count).to eq(3)+ expect(EmailLog.where(post_id: new_post.id).count).to eq(2)endit "preserves post attributes" do