/bans: fix undefined ordering when no params are passed.

Fixes the /bans listing being ordered randomly by default.
This commit is contained in:
evazion
2018-01-28 15:38:12 -06:00
parent 100c1d2828
commit 5ea61c6921

View File

@@ -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)