title: "Where" clause with concatenated fields in Rails 3
body: <p>I am writing a rails 3 application, and I have a database table of Users.  The users have first_name and last_name columns.  On my page that lists the users, I want to have a single text search box that allows the user to filter the list.  They need to be able to type into the search box one of the following:
  - A first name of a user
  - A last name of a user
  - A full name of a user (eg. "Smith, John")</p>
  
  <p>I do not know how to write the where clause that will return these results.  The closest I have gotten is below, however the concatenated fields part does not work.</p>
  
  <pre><code>where('(first_name LIKE :search) or (last_name LIKE :search) or ("#{last_name}, #{first_name}" LIKE :search)', :search =&gt; "%#{search}%")
  </code></pre>
  
  <p>I am also interested to know if there is a better way to handle my OR statements, as this clause is getting quite clunky.</p>
  
  <p>Thanks for your help!</p>