title: How to sanitize sql fragment in Rails
body: <p>I have to sanitize a part of sql query. I can do something like this:</p>
  
  <pre><code>class &lt;&lt; ActiveRecord::Base
    public :sanitize_sql
  end
  
  str = ActiveRecord::Base.sanitize_sql(["AND column1 = ?", "two's"], '')
  </code></pre>
  
  <p>But it is not safe because I expose protected method. What is a better way to do it?</p>