Skip to content

Commit 897e263

Browse files
authored
Merge pull request rails#54025 from jjatinggoyal/trilogy-config
Default to the `host` config for db connection for trilogy adapter
2 parents a76264c + d245892 commit 897e263

File tree

1 file changed

+6
-4
lines changed
  • railties/lib/rails/generators/rails/app/templates/config/databases

1 file changed

+6
-4
lines changed

railties/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,23 @@ default: &default
1515
pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
1616
username: root
1717
password:
18-
<% if database.socket -%>
19-
socket: <%= database.socket %>
20-
<% else -%>
2118
host: <%%= ENV.fetch("DB_HOST") { "<%= database.host %>" } %>
22-
<% end -%>
2319

2420
development:
2521
<<: *default
22+
<% if database.socket -%>
23+
socket: <%= database.socket %>
24+
<% end -%>
2625
database: <%= app_name %>_development
2726

2827
# Warning: The database defined as "test" will be erased and
2928
# re-generated from your development database when you run "rake".
3029
# Do not set this db to the same as development or production.
3130
test:
3231
<<: *default
32+
<% if database.socket -%>
33+
socket: <%= database.socket %>
34+
<% end -%>
3335
database: <%= app_name %>_test
3436

3537
# As with config/credentials.yml, you never want to store sensitive information,

0 commit comments

Comments
 (0)