rails distincts
# Here, I am plucking student_id and student_grade based on the distinct student_grade records
StudentResult.distinct(:student_grade).pluck(:student_id, :student_grade)
Fancy Flamingo