about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-06-01 14:53:37 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-06-01 20:53:37 +0200
commit2212dc4aaa6de729d2fe3e39b134b566935b11b7 (patch)
treeec204dc8ee97926545f36cfd5cd58115d1b5198a /config
parente1fdac3e9a173c05c7fd9f5e8bcc255ef4a1e804 (diff)
Update Rails to version 5.1.1 (#3121)
* Update rails to version 5.1.1

* Run `rails app:update`

* Remove the override of polymorphic activity relationship

* Silence warning about otp_secret attribute being unknown to rails

* We will only introduce form_with where we want to use remote data
Diffstat (limited to 'config')
-rw-r--r--config/environments/development.rb4
-rw-r--r--config/environments/production.rb8
-rw-r--r--config/environments/test.rb6
-rw-r--r--config/initializers/new_framework_defaults.rb23
4 files changed, 7 insertions, 34 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 86f29e3f4..c81cf7bbe 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -16,8 +16,9 @@ Rails.application.configure do
   if Rails.root.join('tmp/caching-dev.txt').exist?
     config.action_controller.perform_caching = true
 
+    config.cache_store = :memory_store
     config.public_file_server.headers = {
-      'Cache-Control' => 'public, max-age=172800',
+      'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
     }
   else
     config.action_controller.perform_caching = false
@@ -32,6 +33,7 @@ Rails.application.configure do
 
   # Don't care if the mailer can't send.
   config.action_mailer.raise_delivery_errors = false
+
   config.action_mailer.perform_caching = false
 
   # Print deprecation notices to the Rails logger.
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 750182402..f253ab5c7 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -40,22 +40,16 @@ Rails.application.configure do
   # Allow to specify public IP of reverse proxy if it's needed
   config.action_dispatch.trusted_proxies = [IPAddr.new(ENV['TRUSTED_PROXY_IP'])] unless ENV['TRUSTED_PROXY_IP'].blank?
 
-  # By default, use the lowest log level to ensure availability of diagnostic information
+  # Use the lowest log level to ensure availability of diagnostic information
   # when problems arise.
   config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info').to_sym
 
   # Prepend all log lines with the following tags.
   config.log_tags = [:request_id]
 
-  # Use a different logger for distributed setups.
-  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
-
   # Use a different cache store in production.
   config.cache_store = :redis_store, ENV['REDIS_URL'], REDIS_CACHE_PARAMS
 
-  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
-  # config.action_controller.asset_host = 'http://assets.example.com'
-
   # Ignore bad email addresses and do not raise email delivery errors.
   # Set this to true and configure the email server for immediate delivery to raise delivery errors.
   # config.action_mailer.raise_delivery_errors = false
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 1855aadf2..db98263a6 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -12,10 +12,10 @@ Rails.application.configure do
   # preloads Rails for running tests, you may have to set it to true.
   config.eager_load = false
 
-  # Configure static file server for tests with Cache-Control for performance.
+  # Configure public file server for tests with Cache-Control for performance.
   config.public_file_server.enabled = true
   config.public_file_server.headers = {
-    'Cache-Control' => 'public, max-age=3600'
+    'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
   }
   config.assets.digest = false
 
@@ -28,12 +28,12 @@ Rails.application.configure do
 
   # Disable request forgery protection in test environment.
   config.action_controller.allow_forgery_protection = false
+  config.action_mailer.perform_caching = false
 
   # Tell Action Mailer not to deliver emails to the real world.
   # The :test delivery method accumulates sent emails in the
   # ActionMailer::Base.deliveries array.
   config.action_mailer.delivery_method = :test
-  config.action_mailer.perform_caching = false
 
   # Print deprecation notices to the stderr.
   config.active_support.deprecation = :stderr
diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb
deleted file mode 100644
index f6e72335f..000000000
--- a/config/initializers/new_framework_defaults.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# Be sure to restart your server when you modify this file.
-#
-# This file contains migration options to ease your Rails 5.0 upgrade.
-#
-# Once upgraded flip defaults one by one to migrate to the new default.
-#
-# Read the Rails 5.0 release notes for more info on each option.
-
-# Enable per-form CSRF tokens. Previous versions had false.
-Rails.application.config.action_controller.per_form_csrf_tokens = false
-
-# Enable origin-checking CSRF mitigation. Previous versions had false.
-Rails.application.config.action_controller.forgery_protection_origin_check = false
-
-# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
-# Previous versions had false.
-ActiveSupport.to_time_preserves_timezone = false
-
-# Require `belongs_to` associations by default. Previous versions had false.
-Rails.application.config.active_record.belongs_to_required_by_default = false
-
-# Do not halt callback chains when a callback returns false. Previous versions had true.
-ActiveSupport.halt_callback_chains_on_return_false = true