In Rails 7:
I have an Object which has many Associations.
Associations have a :start_time datetime attribute.
I want to return Objects, ranked in order by number of Associations over a certain period of time.
I have tried:
- creating an array of Associations from date1 to date2
- using group_by and each with object to create a hash of Object.ids and frequencies
but I cannot figure out how to rank them by frequency.
I also think their is an easier way to do this.
I am sure this will get downvoted for lack of detail/code, but the question is very general and the use case common.
Any suggestion is appreciated.