WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 69581ff

Browse files
committed
Fixing ordering bug in "messages by teammates"
Messages were ordered by latest team message, not by latest overall message. Also renamed "teammates" to "team" to reflect the actual behavior, also including the current user.
1 parent c95e730 commit 69581ff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/controllers/topics_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ def apply_filters(base_query)
541541
when "team_messaged"
542542
if team_id
543543
member_alias_ids = Alias.joins(user: :team_members).where(team_members: { team_id: team_id }).select(:id)
544-
base_query = base_query.joins(:messages).where(messages: { sender_id: member_alias_ids }).distinct
544+
base_query = base_query.where(id: Message.where(sender_id: member_alias_ids).select(:topic_id))
545545
end
546546
end
547547
base_query

app/views/topics/_sidebar.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
li = link_to "#{team.name}: not yet read by team", topics_path(filter: "team_unread", team_id: team.id)
2323
li = link_to "#{team.name}: my teammates are reading", topics_path(filter: "team_reading_others", team_id: team.id)
2424
li = link_to "#{team.name}: my team is reading", topics_path(filter: "team_reading_any", team_id: team.id)
25-
li = link_to "#{team.name}: started by teammate", topics_path(filter: "team_started", team_id: team.id)
26-
li = link_to "#{team.name}: messages by teammates", topics_path(filter: "team_messaged", team_id: team.id)
25+
li = link_to "#{team.name}: started by team", topics_path(filter: "team_started", team_id: team.id)
26+
li = link_to "#{team.name}: messages by team", topics_path(filter: "team_messaged", team_id: team.id)
2727
- if user_signed_in? && @available_note_tags.present?
2828
.sidebar-section
2929
h3.sidebar-heading My tags

0 commit comments

Comments
 (0)