I'm trying to count all the records between 2 dates that are finished. This means that the created_at field is between start_date and end_date and the finished_at field is not null.
I can use the following expression to get the records that didn't finish:
Record.count(:all, :conditions => {:created_at => start_date..end_date, :finished_at => nil })
Is there a similar way to count the records where finished at is not nil?