Imagine I have wiki Articles, with many Revisions. I'd like to do a query with ActiveRecord through the database, which only returns those Articles which have Revisions which are updated in the past 24 hours. Is such a thing possible?
I'd imagine it'd be something like:
Articles.find_all(:include => :revisions,
:conditions => {:revision[updated_at] => 1.week.ago..Time.now.utc})
If this isn't possible, is there some type of raw SQL I could pass to find_by_SQL that'd do the trick?