I'm on rails 2.3.5
puts params[:_search]
users = User.find(:all) do
if params[:_search] == "true"
puts "TESTTTTTTTTTTTTTT"
pseudo =~ "%#{params[:pseudo]}%" if params[:pseudo].present?
firstname =~ "%#{params[:firstname]}%" if params[:firstname].present?
lastname =~ "%#{params[:lastname]}%" if params[:lastname].present?
email =~ "%#{params[:email]}%" if params[:email].present?
role =~ "%#{params[:role]}%" if params[:role].present?
end
paginate :page => params[:page], :per_page => params[:rows]
order_by "#{params[:sidx]} #{params[:sord]}"
end
This code always shows that it is doing the following query in server logs:
select * from users
even when the :_search
parm is true
.
What is this code supposed to do? Append where conditions depending on the passed in search condition?
PS: I'm using rails plugin for jqgrid