I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.
Something like:
Record
This has changed slightly in rails 4 and above :distinct => true is now deprecated. Use:
:distinct => true
Record.distinct.count('date')
Or if you want the date and the number:
Record.group(:date).distinct.count(:date)