title: Rails, subtracting dates in nested model
body: <p>Hoping someone can help me here, think I am not seeing something simple.</p>
  
  <p>I'm trying to subtract Date.today from a date field in a nested model.</p>
  
  <p>When I have:</p>
  
  <pre><code>Date.today - Photo.minimum(:date)
  </code></pre>
  
  <p>This works fine, and calculates the difference between the two dates.</p>
  
  <p>But when I have:</p>
  
  <pre><code>Date.today - site.photos.minimum(:date)
  </code></pre>
  
  <p>This throws an 'expected numeric' error. I get the same error when I try Photo.where(site_id: site.id).minimum(:date).</p>
  
  <p>Am I missing something with this error? How come when I use the nested model, it won't calculate the date difference?</p>
  
  <p>My associations are Site has many photos. Photo belongs_to Site.</p>