Looking for a simple method utilizing active record to grab data from two models, combine the data, and then sort the combined output by created_at.
For example:
assume two models, Comment & Like both belongs_to User
return a combined list of @user's comments and likes sorted by date
I know I can do this in SQL but I'd really like an active record solution.
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…