title: Can't modify variable from params inside model
body: <p>I have the following code inside model:</p>
  
  <pre><code>def self.price(start=0, stop=100_000_000)
    where "price &gt;= ? AND price &lt;= ?",
      "#{start} ".delete(' '), "#{stop} ".delete(' ')
  end
  </code></pre>
  
  <p>And the following in controller:</p>
  
  <pre><code>def index
    @businesses = Business.price(params[:price_from], params[:price_to])
  end
  </code></pre>
  
  <p>For example, when <code>params[:price_from]</code> equals <code>'30 000'</code>, last space inside <code>"#{start} ".delete(' ')</code> is deleted, but I can't delete the space between digits and get</p>
  
  <pre><code>PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "30 000"
  </code></pre>
  
  <p>I tried different approaches, like </p>
  
  <pre><code>#{start} ".gsub(/\s+/, '')
  #{start} ".split.join
  </code></pre>
  
  <p>Cloning <code>start</code> doesn't help. What should I do?</p>