rails select

records = User.joins(:posts).select(‘distinct users.*, posts.title as posts_title‘).to_a

records = User.all.select{|user| user.id>13}

你可能感兴趣的:(rails select)