Skip to content

Commit 032d766

Browse files
committed
Fix deprecation warnings for config options
These config options changed in Rails so they were causing errors in the sass-rails tests. This updates the config options with the expected settings.
1 parent 7c1660c commit 032d766

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

test/fixtures/alternate_config_project/config/environments/production.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
config.action_controller.perform_caching = true
1212

1313
# Disable Rails's static asset server (Apache or nginx will already do this)
14-
if config.respond_to?(:serve_static_files)
15-
config.serve_static_files = false
14+
if config.respond_to?(:public_file_server)
15+
config.public_file_server.enabled = false
1616
else
1717
config.serve_static_assets = false
1818
end

test/fixtures/alternate_config_project/config/environments/test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
config.cache_classes = true
99

1010
# Configure static asset server for tests with Cache-Control for performance
11-
if config.respond_to?(:serve_static_files)
12-
config.serve_static_files = true
11+
if config.respond_to?(:public_file_server)
12+
config.public_file_server.enabled = true
1313
else
1414
config.serve_static_assets = true
1515
end
16-
config.static_cache_control = "public, max-age=3600"
16+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
1717

1818
config.eager_load = false
1919

test/fixtures/engine_project/test/dummy/config/environments/production.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# config.action_dispatch.rack_cache = true
2121

2222
# Disable Rails's static asset server (Apache or nginx will already do this).
23-
if config.respond_to?(:serve_static_files)
24-
config.serve_static_files = false
23+
if config.respond_to?(:public_file_server)
24+
config.public_file_server.enabled = false
2525
else
2626
config.serve_static_assets = false
2727
end

test/fixtures/engine_project/test/dummy/config/environments/test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
config.eager_load = false
1414

1515
# Configure static asset server for tests with Cache-Control for performance.
16-
if config.respond_to?(:serve_static_files)
17-
config.serve_static_files = true
16+
if config.respond_to?(:public_file_server)
17+
config.public_file_server.enabled = false
1818
else
1919
config.serve_static_assets = true
2020
end
21-
config.static_cache_control = "public, max-age=3600"
21+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
2222

2323
# Show full error reports and disable caching.
2424
config.consider_all_requests_local = true

test/fixtures/sass_project/config/environments/production.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
config.action_controller.perform_caching = true
1313

1414
# Disable Rails's static asset server (Apache or nginx will already do this)
15-
if config.respond_to?(:serve_static_files)
16-
config.serve_static_files = false
15+
if config.respond_to?(:public_file_server)
16+
config.public_file_server.enabled = false
1717
else
1818
config.serve_static_assets = false
1919
end

test/fixtures/sass_project/config/environments/test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
config.eager_load = false
1212

1313
# Configure static asset server for tests with Cache-Control for performance
14-
if config.respond_to?(:serve_static_files)
15-
config.serve_static_files = true
14+
if config.respond_to?(:public_file_server)
15+
config.public_file_server.enabled = false
1616
else
1717
config.serve_static_assets = true
1818
end
19-
config.static_cache_control = "public, max-age=3600"
19+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
2020

2121
# Show full error reports and disable caching
2222
config.consider_all_requests_local = true

test/fixtures/scss_project/config/environments/production.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
config.action_controller.perform_caching = true
1212

1313
# Disable Rails's static asset server (Apache or nginx will already do this)
14-
if config.respond_to?(:serve_static_files)
15-
config.serve_static_files = false
14+
if config.respond_to?(:public_file_server)
15+
config.public_file_server.enabled = false
1616
else
1717
config.serve_static_assets = false
1818
end

test/fixtures/scss_project/config/environments/test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
config.eager_load = false
1111

1212
# Configure static asset server for tests with Cache-Control for performance
13-
if config.respond_to?(:serve_static_files)
14-
config.serve_static_files = true
13+
if config.respond_to?(:public_file_server)
14+
config.public_file_server.enabled = true
1515
else
1616
config.serve_static_assets = true
1717
end
18-
config.static_cache_control = "public, max-age=3600"
18+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
1919

2020
# Show full error reports and disable caching
2121
config.consider_all_requests_local = true

0 commit comments

Comments
 (0)