Skip to content

Commit 0129ca2

Browse files
committed
Remove deprecated config.serve_static_files
1 parent c861dec commit 0129ca2

File tree

3 files changed

+4
-29
lines changed

3 files changed

+4
-29
lines changed

Diff for: railties/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated `config.serve_static_files`.
2+
3+
*Rafael Mendonça França*
4+
15
* Remove deprecated `config.static_cache_control`.
26

37
*Rafael Mendonça França*

Diff for: railties/lib/rails/application/configuration.rb

-19
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
require "rails/source_annotation_extractor"
55

66
require "active_support/deprecation"
7-
require "active_support/core_ext/string/strip" # for strip_heredoc
87

98
module Rails
109
class Application
@@ -56,24 +55,6 @@ def initialize(*)
5655
@enable_dependency_loading = false
5756
end
5857

59-
def serve_static_files
60-
ActiveSupport::Deprecation.warn <<-eow.strip_heredoc
61-
`config.serve_static_files` is deprecated and will be removed in Rails 5.1.
62-
Please use `config.public_file_server.enabled` instead.
63-
eow
64-
65-
@public_file_server.enabled
66-
end
67-
68-
def serve_static_files=(value)
69-
ActiveSupport::Deprecation.warn <<-eow.strip_heredoc
70-
`config.serve_static_files` is deprecated and will be removed in Rails 5.1.
71-
Please use `config.public_file_server.enabled = #{value}` instead.
72-
eow
73-
74-
@public_file_server.enabled = value
75-
end
76-
7758
def encoding=(value)
7859
@encoding = value
7960
silence_warnings do

Diff for: railties/test/application/configuration_test.rb

-10
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,6 @@ def assert_utf8
369369
end
370370
end
371371

372-
test "config.serve_static_files is deprecated" do
373-
make_basic_app do |application|
374-
assert_deprecated do
375-
application.config.serve_static_files = true
376-
end
377-
378-
assert application.config.public_file_server.enabled
379-
end
380-
end
381-
382372
test "Use key_generator when secret_key_base is set" do
383373
make_basic_app do |application|
384374
application.secrets.secret_key_base = "b3c631c314c0bbca50c1b2843150fe33"

0 commit comments

Comments
 (0)