You could do this. I'm sure there is a better way but if you use eager loading when pulling the current_user object from the database, the overhead shouldn't be bad.
@tasks = current_user.groups.each do |group| @tasks << group.tasks end
You could do this. I'm sure there is a better way but if you use eager loading when pulling the current_user object from the database, the overhead shouldn't be bad.
@tasks = current_user.groups.each do |group| @tasks << group.tasks end