mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-08 07:40:08 +09:00
Compose sidebar lists from existing room scopes
Directs merge Room.directs and order by recency. Shared rooms reuse with_ordered_room and without_direct_rooms, with the STI filter coming from Room.without_directs so the join alias stays rooms. Co-authored-by: Thomas Klemm <github@tklemm.eu>
This commit is contained in:
@@ -28,7 +28,7 @@ class Users::SidebarsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_select ".unread", count: users(:david).memberships.reject { |m| m.room.direct? || !m.unread? }.count
|
||||
end
|
||||
|
||||
test "directs are queried separately and ordered by room recency, not name" do
|
||||
test "directs are ordered by room recency, not name" do
|
||||
older = rooms(:david_and_jason)
|
||||
newer = rooms(:david_and_kevin)
|
||||
older.update_column :updated_at, 2.days.ago
|
||||
|
||||
Reference in New Issue
Block a user