Skip to content

Commit fb7debd

Browse files
orbanbotonddjmb
andauthored
Generate reference to the database in the cache template for all envi… (#279)
* Generate reference to the database in the cache template for all environments. * Set database once in default --------- Co-authored-by: Donal McBreen <[email protected]>
1 parent bda73a2 commit fb7debd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/generators/solid_cache/install/templates/config/cache.yml.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
default: &default
2+
database: <%= ENV.fetch("DATABASE", "cache") %>
23
store_options:
34
# Cap age of oldest cache entry to fulfill retention policies
45
# max_age: <%%= 60.days.to_i %>
@@ -12,5 +13,4 @@ test:
1213
<<: *default
1314

1415
production:
15-
database: <%= ENV.fetch("DATABASE", "cache") %>
1616
<<: *default

test/lib/generators/solid_cache/solid_cache/install_generator_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class SolidCache::InstallGeneratorTest < Rails::Generators::TestCase
3030
def expected_cache_config
3131
<<~YAML
3232
default: &default
33+
database: cache
3334
store_options:
3435
# Cap age of oldest cache entry to fulfill retention policies
3536
# max_age: <%= 60.days.to_i %>
@@ -43,7 +44,6 @@ def expected_cache_config
4344
<<: *default
4445
4546
production:
46-
database: cache
4747
<<: *default
4848
YAML
4949
end

0 commit comments

Comments
 (0)