Remove deprecated config.static_cache_control

This commit is contained in:
Rafael Mendonça França 2017-01-03 19:50:47 -05:00
parent eeac6151a5
commit c861decd44
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
4 changed files with 6 additions and 24 deletions

@ -1,4 +1,8 @@
* The `log:clear` task clear all environments log files by default.
* Remove deprecated `config.static_cache_control`.
*Rafael Mendonça França*
* The `log:clear` task clear all environments log files by default.
*Yuji Yaginuma*

@ -19,7 +19,7 @@ class Configuration < ::Rails::Engine::Configuration
:beginning_of_week, :filter_redirect, :x, :enable_dependency_loading
attr_writer :log_level
attr_reader :encoding, :api_only, :static_cache_control
attr_reader :encoding, :api_only
def initialize(*)
super
@ -56,17 +56,6 @@ def initialize(*)
@enable_dependency_loading = false
end
def static_cache_control=(value)
ActiveSupport::Deprecation.warn <<-eow.strip_heredoc
`config.static_cache_control` is deprecated and will be removed in Rails 5.1.
Please use
`config.public_file_server.headers = { 'Cache-Control' => '#{value}' }`
instead.
eow
@static_cache_control = value
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.

@ -19,7 +19,6 @@ def build_stack
if config.public_file_server.enabled
headers = config.public_file_server.headers || {}
headers["Cache-Control".freeze] = config.static_cache_control if config.static_cache_control
middleware.use ::ActionDispatch::Static, paths["public"].first, index: config.public_file_server.index_name, headers: headers
end

@ -379,16 +379,6 @@ def assert_utf8
end
end
test "config.static_cache_control is deprecated" do
make_basic_app do |application|
assert_deprecated do
application.config.static_cache_control = "public, max-age=60"
end
assert_equal application.config.static_cache_control, "public, max-age=60"
end
end
test "Use key_generator when secret_key_base is set" do
make_basic_app do |application|
application.secrets.secret_key_base = "b3c631c314c0bbca50c1b2843150fe33"