I want to fetch all the items being followed and the for each item I want to fetch all of it's articles in an array to pass it to the view partial. But I am not receiving objects rather I am receiving Active Record relation
Here is my code
@row=[]
@followed_blogs = Follow.where("followable_type == ?","Blog").where(follower_id: current_user.id)
@followed_blogs.each do |blog|
@row << Article.where("blog_id == ?",blog.followable_id)
end
@articles = @row.sort! {|a,b| a.created_at <=> b.created_at}