improved artist test

This commit is contained in:
albert
2013-01-11 16:38:06 -05:00
parent 8749c43b3e
commit c7ffda81bf
4 changed files with 20 additions and 1 deletions

View File

@@ -19,10 +19,18 @@ class Ban < ActiveRecord::Base
q = q.where("banner_id = (select _.id from users _ where lower(_.name) = ?)", params[:banner_name].downcase)
end
if params[:banner_id]
q = q.where("banner_id = ?", params[:banner_id].to_i)
end
if params[:user_name]
q = q.where("user_id = (select _.id from users _ where lower(_.name) = ?)", params[:user_name].downcase)
end
if params[:user_id]
q = q.where("user_id = ?", params[:user_id].to_i)
end
q
end