I’m using Koala api to query Facebook.
@result = @graph.fql_query("select uid, name, pic_square FROM user WHERE is_app_user AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me())")
I’d like to discard some instances of the object @result by querying my ActiveRecords “Shoot”:
@result.each do |f3|
y1 = Shoot.where(:uid1 => f3["uid"])
@y2 = y1
if y1
xtUid = f3["uid"]
xName = f3["name"]
xPicture = f3["pic_square"]
....
end
...
end
I have the following problem. It seems that:
1. y1 is always set as valid but the program doesn’t crash
2. If I replace y1 by y1[0], the program crashes.
I’d appreciate any pointers. Thanks!
I finally found the answer: f3[“uid”].to_s. F3[“uid”] needs to be converted into a string. Thanks @Anthony for helping!