Remove deprecated config.serve_static_files

上级 c861decd
* Remove deprecated `config.serve_static_files`.
*Rafael Mendonça França*
* Remove deprecated `config.static_cache_control`.
*Rafael Mendonça França*
......
......@@ -4,7 +4,6 @@
require "rails/source_annotation_extractor"
require "active_support/deprecation"
require "active_support/core_ext/string/strip" # for strip_heredoc
module Rails
class Application
......@@ -56,24 +55,6 @@ def initialize(*)
@enable_dependency_loading = false
end
def serve_static_files
ActiveSupport::Deprecation.warn <<-eow.strip_heredoc
`config.serve_static_files` is deprecated and will be removed in Rails 5.1.
Please use `config.public_file_server.enabled` instead.
eow
@public_file_server.enabled
end
def serve_static_files=(value)
ActiveSupport::Deprecation.warn <<-eow.strip_heredoc
`config.serve_static_files` is deprecated and will be removed in Rails 5.1.
Please use `config.public_file_server.enabled = #{value}` instead.
eow
@public_file_server.enabled = value
end
def encoding=(value)
@encoding = value
silence_warnings do
......
......@@ -369,16 +369,6 @@ def assert_utf8
end
end
test "config.serve_static_files is deprecated" do
make_basic_app do |application|
assert_deprecated do
application.config.serve_static_files = true
end
assert application.config.public_file_server.enabled
end
end
test "Use key_generator when secret_key_base is set" do
make_basic_app do |application|
application.secrets.secret_key_base = "b3c631c314c0bbca50c1b2843150fe33"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册