Bugs: Browse | Submit New | Admin
There seems to be a bug in this function. uids1 and uids2 will be overwritten with the pair.first and pair.last instead of concatenating them into an array. Thus only one pair is checked regardless of input pairs. def check_friendship(array_of_pairs_of_users) uids1 = [] uids2 = [] array_of_pairs_of_users.each do |pair| uids1 = pair.first uids2 = pair.last end post('facebook.friends.areFriends', :uids1 => uids1, :uids2 => uids2) end
Add A Comment:
Date: 2008-06-20 19:06 Sender: Joel Dudley I've changed the function to act as described: def check_friendship(array_of_pairs_of_users) uids1 = [] uids2 = [] array_of_pairs_of_users.each do |pair| uids1 << pair.first uids2 << pair.last end post('facebook.friends.areFriends', :uids1 => uids1.join(','), :uids2 => uids2.join(',')) end