Skip to content

Commit

Permalink
Fixed order of rooms in postgres (bigbluebutton#979)
Browse files Browse the repository at this point in the history
Co-authored-by: Jesus Federico <[email protected]>
  • Loading branch information
farhatahmad and jfederico authored Mar 4, 2020
1 parent 037e4f1 commit 43911b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def self.admins_order(column, direction)
order(Arel.sql("#{column} #{direction}"))
end

# Returns a list of rooms ordered by last session
# Returns a list of rooms ordered by last session (with nil rooms last)
def ordered_rooms
[main_room] + rooms.where.not(id: main_room.id).order("last_session desc")
[main_room] + rooms.where.not(id: main_room.id).order(Arel.sql("last_session IS NULL, last_session desc"))
end

# Activates an account and initialize a users main room
Expand Down

0 comments on commit 43911b9

Please sign in to comment.