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

When I use mongoid, turn devise_token_auth:install to devise_token_auth:install:mongoid #143

Open
lukefan opened this issue Dec 29, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@lukefan
Copy link

lukefan commented Dec 29, 2020

What is the problem the enhancement will solve?

When I use mongoid and run rails g graphql_devise:install, I got an error, Uninitialized ActiveRecord.

Describe the solution you have in mind

I changed install_generator.rb, from generate 'devise_token_auth:install', "#{user_class} #{mount_path}" to generate 'devise_token_auth:install_mongoid', "#{user_class} #{mount_path}"

it worked.
Please check database first, before run.

@00dav00 00dav00 added the enhancement New feature or request label Dec 29, 2020
@00dav00
Copy link
Contributor

00dav00 commented Dec 29, 2020

Hey @lukefan , I see what you are saying!
If you are interested in creating a PR for this I would say a new boolean argument called mongoid that will determine which DTA generator is executed is the simplest way to go. Otherwise we can take a look as soon as we have some spare time.
Let me know if you want to discuss this further.

@lukefan
Copy link
Author

lukefan commented Dec 30, 2020

There is a simple way, make two install_generator, graphql_devise:install and graphql_devise:install_mongoid, just like devise_token_auth.

@00dav00
Copy link
Contributor

00dav00 commented Dec 31, 2020

That solution is in fact the one we would prefer in the long term, that said it will imply some refactor to make sure code is reused in both generators instead of duplicating it.

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

No branches or pull requests

2 participants