title: Using find_by_sql in range gives error: undefined method `value_for_database' for "2017-01-01":String
body: <p>This error showed up when I was trying to search from a range of date.</p>
  
  <p>This is my model:</p>
  
  <pre><code>def self.search(search)
    if search
      @policies = Policy.find_by_sql("acct_ent_date IN ?", start_date..end_date)
    else
      limit(10)
    end
  end
  </code></pre>