Skip to content

Instantly share code, notes, and snippets.

@terrbear
Created April 13, 2009 19:20
Show Gist options
  • Select an option

  • Save terrbear/94651 to your computer and use it in GitHub Desktop.

Select an option

Save terrbear/94651 to your computer and use it in GitHub Desktop.
existing_invitee_user_ids = []
user_ids[:user_id].each_pair{|key, value|
if value.to_i == 1
existing_invitee_user_ids << key.to_i
end
end
existing_invitee_user_ids.compact!
existing_invitee_user_ids.uniq!
existing_invitee_user_ids
-------
user_ids[:user_id].select{|k, v| v == "1"}.transpose.first.map{|id| id.to_i}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment