title: How to search an integer field in ActiveRecord?
body: <p>I want users to be able to search my database using this function:</p>
  
  <pre><code>def self.search(query)
    new_query = (query.to_d * 100).to_i
    where("price_in_cents LIKE ?", new_query)
  end
  </code></pre>
  
  <p>The problem is that all my <code>prices</code> are stored in the database as <code>integers</code>, so if someone searches for "10.99" he should <em>actually</em> search for "1099".</p>
  
  <p>The function above doesn't work, though, and I wonder what I am doing wrong.</p>
  
  <p>Thanks for any help.</p>