We've got a nested method we're trying to update for Rails 3. However,
it appears to be generating invalid sql. The old Rails 2 method
worked. What am I doing wrong?
# The tables in question are sites, photos, site_photos
# In the Site model
has_many :photos, :through => :site_photos do
# Old method. This works.
# find :all, :select => 'distinct date_taken', :order =>
# Attempt at an updated version for Rails 3. This fails.
# It generates invalid sql. This is the bit that's invalid:
SELECT "photos".*, distinct(date_taken) FROM "photos";