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

Generator doesn't work correctly with mongoid and/or rails-api #14

Closed
smarquez1 opened this issue Aug 12, 2014 · 6 comments
Closed

Generator doesn't work correctly with mongoid and/or rails-api #14

smarquez1 opened this issue Aug 12, 2014 · 6 comments

Comments

@smarquez1
Copy link

Hi, I'm using your gem for a rails-api / mongoid project and I had a couple of issues using the generator:

Mongoid: it doesn't add the concern to the model, also it creates a migration (not necessary since it doesn't use activerecord)

Rails-api: it doesn't add the concern to ApplicationController, rails-api uses controllers based on ActionController::API so maybe that's where the issue is

Thanks!

@lynndylanhurley
Copy link
Owner

Thanks @smarquez1 - I don't have much experience with mongoid, but I'll take a look and see what it takes to add support. Please continue to post issues as you find them.

@jasonswett
Copy link
Contributor

I'm also using Rails::API, but not Mongoid. I didn't realize the SetUserByToken concern was supposed to be added to ApplicationController automatically. That would have been helpful, as it wasn't obvious to me that that concern needed to be there at all, and I only discovered the need to add it after a lot of digging.

Might it make sense to create a separate issue for including the SetUserByToken concern in a Rails::API ApplicationController, since that doesn't seem to have anything to do with Mongoid? I'd be willing to take a crack at the actual implementation.

@andimal
Copy link

andimal commented Jan 21, 2015

@jasonswett + @smarquez1: thankyouthankyouthankyou!

ApplicationController << include DeviseTokenAuth::Concerns::SetUserByToken for rails-api

@scanferla
Copy link

+1

ApplicationController << include DeviseTokenAuth::Concerns::SetUserByToken for rails-api

@booleanbetrayal
Copy link
Collaborator

accepting PRs for this if anyone would like to implement this feature

@aarongray
Copy link
Contributor

The rails-api issue (the concern not getting inserted into the application controller) has been fixed on #350.

@dks17 dks17 mentioned this issue Aug 27, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants