Skip to content

Commit 463b5d7

Browse files
committed
Remove deprecated serve_static_assets configuration
1 parent c2e8658 commit 463b5d7

File tree

3 files changed

+4
-37
lines changed

3 files changed

+4
-37
lines changed

railties/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated `serve_static_assets` configuration.
2+
3+
*Rafael Mendonça França*
4+
15
* Use local variables in `_form.html.erb` partial generated by scaffold.
26

37
*Andrew Kozlov*

railties/lib/rails/application/configuration.rb

-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require 'active_support/core_ext/kernel/reporting'
2-
require 'active_support/core_ext/string/filters'
32
require 'active_support/file_update_checker'
4-
require 'active_support/deprecation'
53
require 'rails/engine/configuration'
64
require 'rails/source_annotation_extractor'
75

@@ -132,25 +130,6 @@ def colorize_logging=(val)
132130
self.generators.colorize_logging = val
133131
end
134132

135-
# :nodoc:
136-
SERVE_STATIC_ASSETS_DEPRECATION_MESSAGE = <<-MSG.squish
137-
The configuration option `config.serve_static_assets` has been renamed
138-
to `config.serve_static_files` to clarify its role (it merely enables
139-
serving everything in the `public` folder and is unrelated to the asset
140-
pipeline). The `serve_static_assets` alias will be removed in Rails 5.0.
141-
Please migrate your configuration files accordingly.
142-
MSG
143-
144-
def serve_static_assets
145-
ActiveSupport::Deprecation.warn SERVE_STATIC_ASSETS_DEPRECATION_MESSAGE
146-
serve_static_files
147-
end
148-
149-
def serve_static_assets=(value)
150-
ActiveSupport::Deprecation.warn SERVE_STATIC_ASSETS_DEPRECATION_MESSAGE
151-
self.serve_static_files = value
152-
end
153-
154133
def session_store(*args)
155134
if args.empty?
156135
case @session_store

railties/test/application/configuration_test.rb

-16
Original file line numberDiff line numberDiff line change
@@ -320,22 +320,6 @@ def assert_utf8
320320
end
321321
end
322322

323-
test "config.serve_static_assets is deprecated" do
324-
require "#{app_path}/config/application"
325-
326-
assert_deprecated(/serve_static_assets/) do
327-
app.config.serve_static_assets = false
328-
end
329-
330-
assert_not app.config.serve_static_files
331-
assert_deprecated(/serve_static_assets/) { assert_not app.config.serve_static_assets }
332-
333-
app.config.serve_static_files = true
334-
335-
assert app.config.serve_static_files
336-
assert_deprecated(/serve_static_assets/) { assert app.config.serve_static_assets }
337-
end
338-
339323
test "Use key_generator when secret_key_base is set" do
340324
make_basic_app do |application|
341325
application.secrets.secret_key_base = 'b3c631c314c0bbca50c1b2843150fe33'

0 commit comments

Comments
 (0)