Closed adilsoncarvalho closed 3 years ago
Oh, I see that the routes not showing is expected as mentioned at janko/rodauth-rails#5. It seems to see the source code of rodauth is the only way for now. 😞
For the database connection issue, add test: false
in config/initializers/sequel.rb
:
DB = Sequel.postgres(extensions: :activerecord_connection, test: false)
I'll probably update rodauth-rails to include test: false
as well by default, as I haven't accounted for the rails db:create
task.
Do an API only app require the app/controllers/rodauth_controller.rb file?
No, it doesn't. Feel free to remove it, and remove the rails_controller { RodauthController }
line in your rodauth_app.rb
. I'll update rodauth-rails to do this as well.
Yes, the fact that a complete list of routes isn't mentioned in Rodauth documentation is not ideal. I'll think about how this can be addressed.
I am testing locally to create the database with test: false
in config/initializers/sequel.rb
.
🎉 Yeap. Works flawlessly. Thanks for helping me with adding rodauth in my app.
rake db:create
Created database 'api_development'
Created database 'api_test'
That's good to hear!
I've addressed both of the these issues (test: false
and RodauthController
) in 0.4.1, so I'm closing this one.
Thank you for providing a fix so quickly.
🎉 The invocation of
flash
method is fixed!Unfortunately, the database problem still happening. I discovered that it only happens when I try to create the database. I created a repo with the vanilla rails API app I used and my docker setup. I hope it helps.
The steps:
rake db:create
-- it fails (see trace below)config/initializers/sequel.rb
rake db:create
-- it succeedsconfig/initializers/sequel.rb
rake db:migrate
-- it succeedsI have the following questions:
rails routes
? I only got the default Rails routes.app/controllers/rodauth_controller.rb
file?Here is the trace for the failed
rake db:create
. It feels like some other component tries to reach the database before its creation, and then fails because it doesn't exist.Originally posted by @adilsoncarvalho in https://github.com/janko/rodauth-rails/issues/13#issuecomment-720428201