Rails ActiveRecord friendly code from a Complex Join, Sum, and Group query
- by Chad M
PROBLEM
Hello,
I am having no luck trying to break down this SQL statement into ActiveRecord/Rails friendly code and I'd like to learn how I can avoid a find_by_sql statement in this situation.
Scenario
I have users that create audits when they perform an action. Each audit is of a specific audit_activity. Each audit_activity is worth a certain…