0

I'm setting up an OAuth consumer rails app using a gem called oauth_plugin (https://github.com/pelle/oauth-plugin)

On my app users have access to multiple projects and each project needs to be able to connect to a different Google Analytics account using OAuth (so I can pull stats for each one).

The default set up for oauth_plugin is for OAuth tokens to be associated with users. I've tried to change it to be associated with projects by changing the models and controllers but if I do that I get this error when trying to connect the service:

ActiveRecord::StatementInvalid in OauthConsumersController#show

SQLite3::SQLException: no such column: consumer_tokens.user_id: 
SELECT  "consumer_tokens".* FROM "consumer_tokens"  WHERE "consumer_tokens"."type" IN ('GoogleToken') AND "consumer_tokens"."user_id" = '1' LIMIT 1 

There's nothing in my controllers like this so I'm guessing it's in the plugin somewhere. Does anyone know how I could get around this?

Let me know if you need more info. Thanks!

4

0 回答 0