title: Run postgres function with rails
body: <pre><code>User.select("id, first_name, test(id)").where(id: [1,2,3,4,42]).within(50, :origin =&gt; [24.0, 75.5])
  </code></pre>
  
  <p>here test is a db function which takes user_id and within chain method is of geokit-rails gem</p>
  
  <p>It is throwing error </p>
  
  <blockquote>
    <p>ArgumentError: wrong number of arguments (given 0, expected 2..3)</p>
  </blockquote>
  
  <p>Any idea about it? Normally test function works with raw sql and I want to calculate near points (within range) so I need the within chain method thaats why dont want to use raw sql</p>