2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-10-03 17:21:20 +08:00
This commit is contained in:
Jarek Radosz 2025-10-02 23:45:19 +02:00
parent ff2434928e
commit f721886da3
No known key found for this signature in database
GPG key ID: 98C198E7019429B3
5 changed files with 6 additions and 19 deletions

View file

@ -459,10 +459,7 @@ class InvitesController < ApplicationController
return render_json_error(I18n.t("rate_limiter.slow_down"))
end

Invite
.pending(current_user)
.where.not(email: nil)
.find_each { |invite| invite.resend_invite }
Invite.pending(current_user).where.not(email: nil).find_each { |invite| invite.resend_invite }

render json: success_json
end

View file

@ -190,14 +190,10 @@ class DiscourseConnect < DiscourseConnectBase
desired_groups = Group.where("LOWER(NAME) in (?) AND NOT automatic", names)

to_be_added = desired_groups
if current_groups.present?
to_be_added = to_be_added.where.not(id: current_groups.map(&:id))
end
to_be_added = to_be_added.where.not(id: current_groups.map(&:id)) if current_groups.present?

to_be_removed = current_groups
if desired_groups.present?
to_be_removed = to_be_removed.where.not(id: desired_groups.map(&:id))
end
to_be_removed = to_be_removed.where.not(id: desired_groups.map(&:id)) if desired_groups.present?

if to_be_added.present? || to_be_removed.present?
GroupUser.transaction do

View file

@ -308,9 +308,7 @@ class Notification < ActiveRecord::Base
[
Notification.types[:liked],
Notification.types[:liked_consolidated],
].each do |notification_type|
notifications = notifications.where.not(notification_type:)
end
].each { |notification_type| notifications = notifications.where.not(notification_type:) }
end

notifications = notifications.to_a

View file

@ -37,9 +37,7 @@ DiscourseAutomation::Scriptable.add(

category_users = []
existing_users =
CategoryUser
.where(category_id:, user_id: user_ids)
.where.not(notification_level: nil)
CategoryUser.where(category_id:, user_id: user_ids).where.not(notification_level: nil)
skip_user_ids = existing_users.pluck(:user_id)

batch.each do |group_user|

View file

@ -19,9 +19,7 @@ module Chat
return false if post.topic.private_message?

quoted_users = extract_quoted_users(post)
if @notified_users.present?
quoted_users = quoted_users.where.not(id: @notified_users)
end
quoted_users = quoted_users.where.not(id: @notified_users) if @notified_users.present?

opts = { user_id: post.user.id, display_username: post.user.username }
quoted_users.each do |user|