Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with Mongoid #142

Open
kpgarrod opened this issue Jul 27, 2013 · 0 comments
Open

Trouble with Mongoid #142

kpgarrod opened this issue Jul 27, 2013 · 0 comments

Comments

@kpgarrod
Copy link

I had problems getting the plugin to work with Mongoid out of the box.

I had to override OauthConsumersController#load_consumer with this:

def load_consumer
    throw RecordNotFound unless OAUTH_CREDENTIALS.include?(consumer_key)
    deny_access! unless logged_in? || consumer_credentials[:allow_login]
    @consumer="#{consumer_key.to_s.camelcase}Token".constantize
    @token=current_user.consumer_tokens.where(type: @consumer).first if logged_in?
  end

It seems to me that this should work with ActiveRecord just as well as the original code, but I haven't tested it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant