Let's say I run an ActiveRecord query and it returns 3 results, with a bunch of attributes.
I want to add 3 attributes to each record in the Array so I can do sorting at a code-level. These 3 include: num_comments, num_views, last_view.
- How do I add these attributes?
- How do I then sort the records, in order of precendence, by num_comments AND by num_views AND by last_view?