title: Pattern matching in rails ( "where column LIKE '%foo%") with Postgres
body: <p>I have a Person model that includes names, and I want to search these as simply as possible.</p>
  
  <p>Is there a rails/ActiveRecord method along the lines of <code>People.like(:name =&gt; "%#{query}%")</code>, like what DataMapper has? I couldn't find anything like this in the ActiveRecord docs but I'm shocked if it's simply not possible.</p>
  
  <p>Currently I have it doing <code>Person.where "name LIKE '%#{query}%'"</code>, which works great but is an obvious SQL-injection vulnerability.</p>
  
  <p>Rails 3.2</p>