Project

General

Profile

Patch #3882 ยป add_search_user_by_mail.patch

Lucas Panjer, 2009-09-16 21:48

View differences:

app/controllers/users_controller.rb (working copy)
unless params[:name].blank?
name = "%#{params[:name].strip.downcase}%"
c << ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ?", name, name, name]
c << ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ? OR LOWER(mail) LIKE ?", name, name, name, name]
end
@user_count = User.count(:conditions => c.conditions)
    (1-1/1)