Skip to content

Instantly share code, notes, and snippets.

@TrevorHinesley
Last active August 29, 2015 13:56
Show Gist options
  • Save TrevorHinesley/9279613 to your computer and use it in GitHub Desktop.
Save TrevorHinesley/9279613 to your computer and use it in GitHub Desktop.
Preferred College athlete_ids
athlete_ids = {}
PreferredCollege.all.each do |pc|
athlete_ids[pc.athlete_id.to_s].blank? ? athlete_ids[pc.athlete_id.to_s] = [pc.college_id] : athlete_ids[pc.athlete_id.to_s] << pc.college_id end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment