fixes to model searches

This commit is contained in:
albert
2013-02-19 12:27:17 -05:00
parent e678427ee7
commit e0fdda3103
21 changed files with 68 additions and 68 deletions

View File

@@ -464,19 +464,19 @@ class User < ActiveRecord::Base
q = scoped
return q if params.blank?
if params[:name]
if params[:name].present?
q = q.name_matches(params[:name].downcase)
end
if params[:name_matches]
if params[:name_matches].present?
q = q.name_matches(params[:name_matches].downcase)
end
if params[:min_level]
if params[:min_level].present?
q = q.where("level >= ?", params[:min_level].to_i)
end
if params[:id]
if params[:id].present?
q = q.where("id = ?", params[:id].to_i)
end