records = User.joins(:posts).select(‘distinct users.*, posts.title as posts_title‘).to_arecords = User.all.select{|user| user.id>13}