about summary refs log tree commit diff
path: root/config/environments
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-08-17 17:56:23 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-08-17 17:58:00 +0200
commit10ba09f5466fe3d34a5ed78202c35f4e4f9d30e6 (patch)
treeed1a2f603198053a6872d3ac74ee69ba4990fdf3 /config/environments
parentff2cbc07530d87132af09900b4d0c9ada9d3e716 (diff)
Upgrade to Rails 5.0.0.1
Diffstat (limited to 'config/environments')
-rw-r--r--config/environments/development.rb29
-rw-r--r--config/environments/production.rb16
-rw-r--r--config/environments/test.rb10
3 files changed, 32 insertions, 23 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 564630813..1affeca11 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -9,12 +9,26 @@ Rails.application.configure do
   # Do not eager load code on boot.
   config.eager_load = false
 
-  # Show full error reports and disable caching.
-  config.consider_all_requests_local       = true
-  config.action_controller.perform_caching = false
+  # Show full error reports.
+  config.consider_all_requests_local= true
+
+  # Enable/disable caching. By default caching is disabled.
+  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'
+    }
+  else
+    config.action_controller.perform_caching = false
+
+    config.cache_store = :null_store
+  end
 
   # 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.
   config.active_support.deprecation = :log
@@ -27,9 +41,8 @@ Rails.application.configure do
   # number of complex assets.
   config.assets.debug = true
 
-  # Asset digests allow you to set far-future HTTP expiration dates on all assets,
-  # yet still be able to expire them through the digest params.
-  config.assets.digest = true
+  # Suppress logger output for asset requests.
+  config.assets.quiet = true
 
   # Adds additional error checking when serving assets at runtime.
   # Checks for improperly declared sprockets dependencies.
@@ -39,6 +52,10 @@ Rails.application.configure do
   # Raises error for missing translations
   # config.action_view.raise_on_missing_translations = true
 
+  # Use an evented file watcher to asynchronously detect changes in source code,
+  # routes, locales, etc. This feature depends on the listen gem.
+  # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
+
   config.action_mailer.delivery_method = :letter_opener
 
   config.after_initialize do
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 182f15493..4c4ed760c 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -14,15 +14,9 @@ Rails.application.configure do
   config.consider_all_requests_local       = false
   config.action_controller.perform_caching = true
 
-  # Enable Rack::Cache to put a simple HTTP cache in front of your application
-  # Add `rack-cache` to your Gemfile before enabling this.
-  # For large-scale production use, consider using a caching reverse proxy like
-  # NGINX, varnish or squid.
-  # config.action_dispatch.rack_cache = true
-
   # Disable serving static files from the `/public` folder by default since
   # Apache or NGINX already handles this.
-  config.serve_static_files = true
+  config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
 
   # Compress JavaScripts and CSS.
   config.assets.js_compressor = :uglifier
@@ -31,10 +25,6 @@ Rails.application.configure do
   # Do not fallback to assets pipeline if a precompiled asset is missed.
   config.assets.compile = false
 
-  # Asset digests allow you to set far-future HTTP expiration dates on all assets,
-  # yet still be able to expire them through the digest params.
-  config.assets.digest = true
-
   # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
 
   # Specifies the header that your server uses for sending files.
@@ -49,7 +39,7 @@ Rails.application.configure do
   config.log_level = :debug
 
   # Prepend all log lines with the following tags.
-  # config.log_tags = [ :subdomain, :uuid ]
+  config.log_tags = [ :request_id ]
 
   # Use a different logger for distributed setups.
   # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
@@ -77,6 +67,8 @@ Rails.application.configure do
   # Do not dump schema after migrations.
   config.active_record.dump_schema_after_migration = false
 
+  config.action_mailer.perform_caching = false
+
   # E-mails
   config.action_mailer.smtp_settings = {
     :port           => ENV['SMTP_PORT'],
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 1ef379f40..fea1c51fd 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -13,8 +13,10 @@ Rails.application.configure do
   config.eager_load = false
 
   # Configure static file server for tests with Cache-Control for performance.
-  config.serve_static_files   = true
-  config.static_cache_control = 'public, max-age=3600'
+  config.public_file_server.enabled = true
+  config.public_file_server.headers = {
+    'Cache-Control' => 'public, max-age=3600'
+  }
   config.assets.digest = false
 
   # Show full error reports and disable caching.
@@ -31,9 +33,7 @@ Rails.application.configure do
   # The :test delivery method accumulates sent emails in the
   # ActionMailer::Base.deliveries array.
   config.action_mailer.delivery_method = :test
-
-  # Randomize the order test cases are executed.
-  config.active_support.test_order = :random
+  config.action_mailer.perform_caching = false
 
   # Print deprecation notices to the stderr.
   config.active_support.deprecation = :stderr