Skip to content
Permalink
Browse files

Remove deprecated config.serve_static_files

  • Loading branch information
rafaelfranca committed Jan 4, 2017
1 parent c861dec commit 0129ca2eeb6d5b2ea8c6e6be38eeb770fe45f1fa
@@ -1,3 +1,7 @@
* 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"

0 comments on commit 0129ca2

Please sign in to comment.
You can’t perform that action at this time.