Created
July 1, 2011 07:30
-
-
Save radixhound/1058044 to your computer and use it in GitHub Desktop.
example of situation where our code blows up with mysql2 'connection is still waiting for a result' errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users < Foodtree::API | |
class MissingUserIDError < BadRequestError ; end | |
def response(env) | |
resp = route_request #this will send PUT to update | |
resp | |
end | |
def update | |
if user = User.find(params[:id]) | |
[200, {}, {:object => user, :user_id => user.id}] | |
else | |
raise MissingUserIDError | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment