title: undefined method generated by controller action when apparently defined in model
body: <p>The class has the following methods defined in the model:</p>
  
  <pre><code>def EWKB
    RGeo::WKRep::WKBGenerator.new(:type_format =&gt; :ewkb, :emit_ewkb_srid =&gt; true, :hex_format =&gt; true)
  end
  
  def self.containing_latlon(lat, lon, polygon)
    ewkb = EWKB.generate(FACTORY.point(lon, lat).projection)
    where("ST_Intersects(polygon, ST_GeomFromEWKB(E'\\\\x#{ewkb}'))")
  end
  </code></pre>
  
  <p>When calling an action in the class controller as such</p>
  
  <pre><code>point_in = containing_latlon(@point_p.lat, @point_p.lon, @polygon)
  </code></pre>
  
  <p>Rails returns a NoMethodError</p>
  
  <pre><code>undefined method `containing_latlon' 
  </code></pre>
  
  <p>I fail to understand why this method is deemed undefined</p>
  
  <p><strong>Edit</strong><br>
  garry's comment below is correct.</p>