GRN2-264: Allow users to change the room settings on Home Room (#951)

* GRN2-264: Allow users to change the room settings on Home Room

* fixing inconsistencies

* removing 'secondary_rooms' method and adjusting looping
This commit is contained in:
etiennevvv
2020-02-11 13:47:11 -05:00
committed by farhatahmad
parent 01c93b1f67
commit b67bee2638
5 changed files with 24 additions and 44 deletions

View File

@ -130,12 +130,6 @@ class User < ApplicationRecord
reset_sent_at < 2.hours.ago
end
# Retrives a list of all a users rooms that are not the main room, sorted by last session date.
def secondary_rooms
room_list = rooms.where.not(uid: main_room.uid)
room_list.where.not(last_session: nil).order("last_session desc") + room_list.where(last_session: nil)
end
# Retrieves a list of rooms that are shared with the user
def shared_rooms
Room.where(id: shared_access.pluck(:room_id))