/bans: fix undefined ordering when no params are passed.
Fixes the /bans listing being ordered randomly by default.
This commit is contained in:
@@ -27,7 +27,6 @@ class Ban < ApplicationRecord
|
||||
|
||||
def self.search(params)
|
||||
q = super
|
||||
return q if params.blank?
|
||||
|
||||
if params[:banner_name]
|
||||
q = q.where("banner_id = (select _.id from users _ where lower(_.name) = ?)", params[:banner_name].mb_chars.downcase)
|
||||
|
||||
Reference in New Issue
Block a user