Fixed bugs in administrator panel (#1047)

This commit is contained in:
Ahmad Farhat
2020-03-20 11:18:05 -04:00
committed by GitHub
parent 4cc45ab017
commit 03cdbd6b69
2 changed files with 4 additions and 2 deletions

View File

@ -49,7 +49,9 @@ class Room < ApplicationRecord
# Include the owner of the table
table = joins(:owner)
return table.order(Arel.sql("rooms.#{column} #{direction}")) if table.column_names.include?(column) || column == "users.name"
return table.order(Arel.sql("rooms.#{column} #{direction}")) if table.column_names.include?(column)
return table.order(Arel.sql("#{column} #{direction}")) if column == "users.name"
table
end