Skip to content

Commit 57471f9

Browse files
committed
Remove FactoryBot line that was initiating db connection on app startup
Was preventing us from creating a database with bin/rails db:create because it tried to connect to that same database before it was able to be created.
1 parent 6b46dd8 commit 57471f9

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

Diff for: .env.example

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ force_ssl=false
99
time_zone="Pacific Time (US & Canada)"
1010

1111
# Database configuration (required)
12-
db_database=postgres
1312
db_username=postgres
1413
db_password=mysecretpassword
1514
db_port=5432

Diff for: .github/workflows/rails_ci.yml

-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
# run tests and linters.
77
name: "Ruby on Rails CI"
88
on: push
9-
# push:
10-
# branches: [ $default-branch, 2024-upgrades-main ]
11-
# pull_request:
12-
# branches: [ $default-branch, 2024-upgrades-main ]
139
jobs:
1410
test:
1511
runs-on: ubuntu-latest
@@ -26,7 +22,6 @@ jobs:
2622
ports:
2723
- "5432:5432"
2824
env:
29-
POSTGRES_DB: actioncenter_test # must be same as in database.yml for test.database
3025
POSTGRES_USER: testuser
3126
POSTGRES_PASSWORD: password
3227
options: >-

Diff for: config/database.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ common: &common
1111

1212
development:
1313
<<: *common
14-
database: <%= Rails.application.secrets.db_database || "actioncenter_development" %>
14+
database: act_development
1515

1616
production:
1717
<<: *common
1818
database: <%= Rails.application.secrets.db_database %>
1919

2020
test: &test
2121
<<: *common
22-
database: actioncenter_test
22+
database: act_test
2323

2424
cucumber:
2525
<<: *test

Diff for: spec/factories/users.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FactoryBot.define do
44
factory :unconfirmed_user, class: User do
5-
sequence(:email, ActiveRecord::Base.connection.table_exists?("users") ? User.next_id : 0) { |n| "person_#{n}@example.com" }
5+
sequence(:email) { |n| "person_#{n}@example.com" }
66
password { "strong passwords defeat lobsters covering wealth" }
77
end
88

0 commit comments

Comments
 (0)