mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 14:42:46 +08:00
FIX: Always include the first poster when converting to PM (#16187)
Regressed in #15626
This commit is contained in:
parent
de9a031073
commit
383f164672
|
@ -63,7 +63,7 @@ class TopicConverter
|
||||||
private
|
private
|
||||||
|
|
||||||
def posters
|
def posters
|
||||||
@posters ||= @topic.posts.where("post_number > 1").distinct.pluck(:user_id)
|
@posters ||= @topic.posts.distinct.pluck(:user_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def increment_users_post_count
|
def increment_users_post_count
|
||||||
|
|
|
@ -200,6 +200,11 @@ describe TopicConverter do
|
||||||
expect(private_message.topic_allowed_users.count).to eq(1)
|
expect(private_message.topic_allowed_users.count).to eq(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "includes the poster of a single-post topic" do
|
||||||
|
moderator = Fabricate(:moderator)
|
||||||
|
private_message = topic.convert_to_private_message(moderator)
|
||||||
|
expect(private_message.allowed_users).to match_array([topic.user, moderator])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'topic has replies' do
|
context 'topic has replies' do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user