diff --git a/app/models/post.rb b/app/models/post.rb index aa1e03f79..7584c7522 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -439,7 +439,7 @@ class Post < ActiveRecord::Base new_user: new_user.username_lower ) - revise(actor, { raw: self.raw, user_id: new_user.id, edit_reason: edit_reason }) + revise(actor, {raw: self.raw, user_id: new_user.id, edit_reason: edit_reason}, bypass_bump: true) if post_number == topic.highest_post_number topic.update_columns(last_post_user_id: new_user.id) diff --git a/spec/services/post_owner_changer_spec.rb b/spec/services/post_owner_changer_spec.rb index 6328fac29..9f07e0bfa 100644 --- a/spec/services/post_owner_changer_spec.rb +++ b/spec/services/post_owner_changer_spec.rb @@ -20,9 +20,12 @@ describe PostOwnerChanger do end it "changes the user" do + bumped_at = topic.bumped_at + old_user = p1.user PostOwnerChanger.new(post_ids: [p1.id], topic_id: topic.id, new_owner: user_a, acting_user: editor).change_owner! p1.reload + expect(p1.topic.bumped_at).to eq(bumped_at) expect(p1.topic.last_post_user_id).to eq(user_a.id) expect(old_user).not_to eq(p1.user) expect(p1.user).to eq(user_a)