Imagine I have wiki articles with many versions. I would like to query ActiveRecord through a database that only returns articles that have revisions that have been updated in the last 24 hours. Is it possible?
I would suggest that it would be something like:
Articles.find_all(:include => :revisions, :conditions => {:revision[updated_at] => 1.week.ago..Time.now.utc})
If this is not possible, is there some raw SQL code that I could pass find_by_SQL that would do the trick?
include ruby-on-rails activerecord condition findall
William jones
source share