graphql_devise icon indicating copy to clipboard operation
graphql_devise copied to clipboard

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

Open lukefan opened this issue 4 years ago • 3 comments

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.

lukefan avatar Dec 29 '20 09:12 lukefan

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.

00dav00 avatar Dec 29 '20 15:12 00dav00

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

lukefan avatar Dec 30 '20 11:12 lukefan

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.

00dav00 avatar Dec 31 '20 17:12 00dav00