diff config/environments/development.rb @ 459:07d6c6639adf

Upgrade to rails 5.2. RIP code style.
author nanaya <me@nanaya.pro>
date Sat, 14 Apr 2018 04:19:52 +0900
parents d31fe32da7a0
children fd3078b4d355
line wrap: on
line diff
--- a/config/environments/development.rb	Sat Apr 14 04:19:29 2018 +0900
+++ b/config/environments/development.rb	Sat Apr 14 04:19:52 2018 +0900
@@ -9,15 +9,17 @@
   # Do not eager load code on boot.
   config.eager_load = false
 
-  # Show full error reports and disable caching.
+  # 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 = false
+  # Run rails dev:cache to toggle caching.
+  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.to_i}"
     }
   else
     config.action_controller.perform_caching = false
@@ -25,8 +27,8 @@
     config.cache_store = :null_store
   end
 
-  # Don't care if the mailer can't send.
-  # config.action_mailer.raise_delivery_errors = false
+  # Store uploaded files on the local file system (see config/storage.yml for options)
+  # config.active_storage.service = :local
 
   # Print deprecation notices to the Rails logger.
   config.active_support.deprecation = :log
@@ -34,18 +36,21 @@
   # Raise an error on page load if there are pending migrations.
   config.active_record.migration_error = :page_load
 
+  # Highlight code that triggered database queries in logs.
+  config.active_record.verbose_query_logs = true
+
   # Debug mode disables concatenation and preprocessing of assets.
   # This option may cause significant delays in view rendering with a large
   # number of complex assets.
   config.assets.debug = true
 
-  # Raises error for missing translations.
-  config.action_view.raise_on_missing_translations = true
-
   # Suppress logger output for asset requests.
   config.assets.quiet = true
 
-  # Use an evented file watcher to asynchronously detect changes in source code
+  # 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
 end