Skip to content

Instantly share code, notes, and snippets.

@msroot
Created April 26, 2012 20:09
Show Gist options
  • Save msroot/2502712 to your computer and use it in GitHub Desktop.
Save msroot/2502712 to your computer and use it in GitHub Desktop.
uid = String
friend = User.find_by_uid(id)
Will not work
#LINE 1: ...LECT "users".* FROM "users" WHERE ("users"."uid" = blah) ...
#2012-04-26T20:00:16+00:00 app[web.1]: ^
#2012-04-26T20:00:16+00:00 app[web.1]: HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
#2012-04-26T20:00:16+00:00 app[web.1]: 43: # OR User.find_by_uid(list) but maybe list is too big? I have to find MAX find args
#2012-04-26T20:00:16+00:00 app[web.1]: : SELECT "users".* FROM "users" WHERE ("users"."uid" = blah) LIMIT 1):
friend = User.find_by_uid(id.to_s)
# will work
#Heroku raise an exeption if is NOT a string
#Local development may work but not in Herolu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment