aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJon Atack <jonnyatack@gmail.com>2015-11-05 12:14:09 +0100
committerJon Atack <jonnyatack@gmail.com>2015-11-05 12:14:09 +0100
commit8fee1515f6f647717e6190811960fdc36477ede7 (patch)
tree527da1fd73e6752b99afaa9ee6270ab32a8b8318 /railties
parent175515ad8bdbe1f87a52c3023d35d434b48e35fc (diff)
downloadrails-8fee1515f6f647717e6190811960fdc36477ede7.tar.gz
rails-8fee1515f6f647717e6190811960fdc36477ede7.tar.bz2
rails-8fee1515f6f647717e6190811960fdc36477ede7.zip
Fix `static_cache_control` deprecation warning
1. Fix the message by wrapping the value in missing quotes and adding the missing backtick at the end. Finally, :lipstick: by adding a space inside the curly braces. Before: `config.public_file_server.headers = {'Cache-Control' => public, max-age=31536000} Now: `config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=31536000' }` 2. Display `static_cache_control` instead of static_cache_control. This follows what the 2 neighboring methods are doing. 3. Use strip_heredoc to improve the code formatting and readability like the 2 neighboring methods and wrap to 80 characters.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application/configuration.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index 7ac010b903..785671f70b 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -56,9 +56,12 @@ module Rails
end
def static_cache_control=(value)
- ActiveSupport::Deprecation.warn("static_cache_control is deprecated and will be removed in Rails 5.1. " \
- "Please use `config.public_file_server.headers = {'Cache-Control' => #{value}} " \
- "instead.")
+ ActiveSupport::Deprecation.warn <<-eow.strip_heredoc
+ `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