Skip to content

Commit 8dc984b

Browse files
local check before db connect
1 parent 2379547 commit 8dc984b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app-rails/config/initializers/devise.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424
end
2525

2626
Rails.application.config.to_prepare do
27-
# Ensure ActiveRecord is connected before loading Devise
28-
User.connection
29-
30-
# Safely load Devise mappings
31-
Devise.mappings[:user]
27+
if Rails.env.development?
28+
User.connection
29+
Devise.mappings[:user]
30+
end
3231
end
3332

3433
# ==> Navigation configuration

app-rails/local.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ COGNITO_USER_POOL_ID=<FILL ME IN>
3434
COGNITO_CLIENT_ID=<FILL ME IN>
3535
COGNITO_CLIENT_SECRET=<FILL ME IN>
3636
USE_DEVISE=true
37+
AUTH_ADAPTER=mock
3738

3839
############################
3940
# Database

0 commit comments

Comments
 (0)