Skip to content

Commit 705878e

Browse files
Merge pull request rails#49851 from Adrian-Hirt/update_environment_templates
Remove `config.public_file_server.enabled` from environment templates
2 parents 2c2ccec + f0a03bd commit 705878e

File tree

7 files changed

+23
-5
lines changed

7 files changed

+23
-5
lines changed

actionmailbox/test/dummy/config/environments/test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
config.eager_load = ENV["CI"].present?
1919

2020
# Configure public file server for tests with Cache-Control for performance.
21-
config.public_file_server.enabled = true
2221
config.public_file_server.headers = {
2322
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
2423
}

actiontext/test/dummy/config/environments/test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
config.eager_load = ENV["CI"].present?
1919

2020
# Configure public file server for tests with Cache-Control for performance.
21-
config.public_file_server.enabled = true
2221
config.public_file_server.headers = {
2322
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
2423
}

activestorage/test/dummy/config/environments/test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
config.eager_load = ENV["CI"].present?
1919

2020
# Configure public file server for tests with Cache-Control for performance.
21-
config.public_file_server.enabled = true
2221
config.public_file_server.headers = {
2322
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
2423
}

railties/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@
3737
3838
*Steve Polito*
3939
40+
* Remove the option `config.public_file_server.enabled` from the generators
41+
for all environments, as the value is the same in all environments.
42+
43+
*Adrian Hirt*
44+
4045
Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/railties/CHANGELOG.md) for previous changes.

railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Rails.application.configure do
1818
config.eager_load = ENV["CI"].present?
1919

2020
# Configure public file server for tests with Cache-Control for performance.
21-
config.public_file_server.enabled = true
2221
config.public_file_server.headers = {
2322
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
2423
}

railties/test/application/assets_test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
250250
test "assets do not require any assets group gem when manifest file is present" do
251251
app_file "app/assets/javascripts/application.js", "alert();"
252252
app_file "app/assets/config/manifest.js", "//= link application.js"
253-
add_to_env_config "production", "config.public_file_server.enabled = true"
254253

255254
precompile! RAILS_ENV: "production"
256255

railties/test/application/configuration_test.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,24 @@ def assert_utf8
695695
assert_equal Pathname.new(app_path).join("somewhere"), Rails.public_path
696696
end
697697

698+
test "In development mode, config.public_file_server.enabled is on by default" do
699+
restore_default_config
700+
701+
with_rails_env "development" do
702+
app "development"
703+
assert app.config.public_file_server.enabled
704+
end
705+
end
706+
707+
test "In test mode, config.public_file_server.enabled is on by default" do
708+
restore_default_config
709+
710+
with_rails_env "test" do
711+
app "test"
712+
assert app.config.public_file_server.enabled
713+
end
714+
end
715+
698716
test "In production mode, config.public_file_server.enabled is on by default" do
699717
restore_default_config
700718

0 commit comments

Comments
 (0)