mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FIX: moving a post to a topic with a deleted post should use correct post_number. Was getting unique index violation on (topic_id, post_number).
This commit is contained in:
@ -575,7 +575,7 @@ class Topic < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def max_post_number
|
||||
posts.maximum(:post_number).to_i
|
||||
posts.with_deleted.maximum(:post_number).to_i
|
||||
end
|
||||
|
||||
def move_posts(moved_by, post_ids, opts)
|
||||
|
Reference in New Issue
Block a user