Skip to content

Instantly share code, notes, and snippets.

@jakeboxer
Created May 20, 2015 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakeboxer/36af0ac0ef04fcfadc1e to your computer and use it in GitHub Desktop.
Save jakeboxer/36af0ac0ef04fcfadc1e to your computer and use it in GitHub Desktop.
nakajima = dat("nakajima")
jake_teams = dat("jakeboxer").teams
orgs = nakajima.organizations.where(:id => jake_teams.map(&:organization_id))
teams = []
orgs.each do |org|
teams += org.visible_teams_for(nakajima).where(:id => jake_teams.map(&:id))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment