discourse/plugins/chat/lib
Andrei Prigorshnev e6299a310f
FIX: Further optimize mentioning groups in chat messages (#24122)
A follow-up to faac6773. This PR eliminates one more heavy join by forcing 
Active Record to do two queries instead.

Also, along the way, I made this change:
```
# this generates two quries to the groups table
def groups_to_mention
  @groups_to_mention = mentionable_groups - groups_with_too_many_members
end

# so I changed it to (this makes only one query to the groups table):
def groups_to_mention
  @groups_to_mention ||= mentionable_groups.where("user_count <= ?", SiteSetting.max_users_notified_per_group_mention)
end
```
This one is kind of a premature optimization, because we don't have evidence that 
this extra query is a problem, but it seems cleaner this way.

Commits history on this PR may help better understand the change.
2023-10-31 18:17:37 +04:00
..
chat FIX: Further optimize mentioning groups in chat messages (#24122) 2023-10-31 18:17:37 +04:00
discourse_dev DEV: Migrate Chat::MessageCreator to a service (#22390) 2023-09-07 08:57:29 +02:00
email_controller_helper
onebox/templates FiX: Update date url for thread oneboxes (#24172) 2023-10-31 08:04:40 -03:00
tasks DEV: Reintroduce chat rake dev generate tasks (#21164) 2023-04-20 10:53:10 +10:00
service_runner.rb DEV: Add policy objects to services 2023-05-25 12:34:00 +02:00