Eliminating Duplicates

How will I convert this into searchlogic query?

@students = Students.find_by_sql([“SELECT DISTINCT * FROM students
WHERE first_name LIKE ? OR last_name LIKE ? GROUP BY first_name,
last_name, middle_name”, params[:first_name], params[:last_name] ])

Thank you,

Jade

Pretty sure something like this will work
Students.where(“first_name like ?”, params[:first_name]).or(“last_name
like
?”, params[:last_name]).group(“first_name, last_name, middle_name”).uniq

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs