mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Missing pending queued posts from topic view (#22838)
A previous change updated `ReviewableQueuedPost`'s `created_by` to be consistent with other reviewable types. It assigns the the creator of the post being queued to `target_created_by` and sets the `created_by` to the creator of the reviewable itself. This fix updates some of the `created_by` references missed during the intial fix.
This commit is contained in:
@@ -459,7 +459,7 @@ module Jobs
|
||||
|
||||
# Most Reviewable fields staff-private, but post content needs to be exported.
|
||||
ReviewableQueuedPost
|
||||
.where(created_by: @current_user.id)
|
||||
.where(target_created_by_id: @current_user.id)
|
||||
.order(:created_at)
|
||||
.each do |rev|
|
||||
yield(
|
||||
|
@@ -101,7 +101,8 @@ class Reviewable < ActiveRecord::Base
|
||||
created_by:,
|
||||
payload: nil,
|
||||
reviewable_by_moderator: false,
|
||||
potential_spam: true
|
||||
potential_spam: true,
|
||||
target_created_by: nil
|
||||
)
|
||||
reviewable =
|
||||
new(
|
||||
@@ -111,6 +112,7 @@ class Reviewable < ActiveRecord::Base
|
||||
reviewable_by_moderator: reviewable_by_moderator,
|
||||
payload: payload,
|
||||
potential_spam: potential_spam,
|
||||
target_created_by: target_created_by,
|
||||
)
|
||||
reviewable.created_new!
|
||||
|
||||
|
@@ -1543,7 +1543,7 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def number_of_rejected_posts
|
||||
ReviewableQueuedPost.rejected.where(created_by_id: self.id).count
|
||||
ReviewableQueuedPost.rejected.where(target_created_by_id: self.id).count
|
||||
end
|
||||
|
||||
def number_of_flags_given
|
||||
|
Reference in New Issue
Block a user