title: Undefined method to_model for ActiveRecord::Relation
body: <p>In my User Controller</p>
  
  <pre><code>def nearby
    @nearby = Trip.near("los angeles, ca", 50)
  end
  </code></pre>
  
  <p>In my User model:</p>
  
  <pre><code>geocoded_by :location
  after_validation :geocode
  </code></pre>
  
  <p>In views/users/nearby.haml</p>
  
  <pre><code>= @nearby.to_json
  </code></pre>
  
  <p>I'm getting the error at this line:</p>
  
  <pre><code>Undefined method to_model for ActiveRecord::Relation
  </code></pre>
  
  <p>This is my routes:</p>
  
  <pre><code>resources :users, :path =&gt; '', only: [] do
    collection do
      get 'nearby'      
    end 
  end
  </code></pre>
  
  <p>Can someone help me narrow in on what the issue could be?</p>