|
|
@ -1,6 +1,8 @@ |
|
|
|
require "active_support/core_ext/integer/time" |
|
|
|
require 'active_support/core_ext/integer/time' |
|
|
|
require_relative '../../lib/formatter/colored_formatter' |
|
|
|
Rainbow.enabled = true |
|
|
|
|
|
|
|
Rails.application.configure do |
|
|
|
Rails.application.configure do # rubocop:disable Metrics/BlockLength |
|
|
|
# Settings specified here will take precedence over those in config/application.rb. |
|
|
|
|
|
|
|
# In the development environment your application's code is reloaded any time |
|
|
@ -19,13 +21,13 @@ Rails.application.configure do |
|
|
|
|
|
|
|
# Enable/disable caching. By default caching is disabled. |
|
|
|
# Run rails dev:cache to toggle caching. |
|
|
|
if Rails.root.join("tmp/caching-dev.txt").exist? |
|
|
|
if Rails.root.join('tmp/caching-dev.txt').exist? |
|
|
|
config.action_controller.perform_caching = true |
|
|
|
config.action_controller.enable_fragment_cache_logging = true |
|
|
|
|
|
|
|
config.cache_store = :memory_store |
|
|
|
config.public_file_server.headers = { |
|
|
|
"Cache-Control" => "public, max-age=#{2.days.to_i}" |
|
|
|
'Cache-Control' => "public, max-age=#{2.days.to_i}" |
|
|
|
} |
|
|
|
else |
|
|
|
config.action_controller.perform_caching = false |
|
|
@ -73,4 +75,7 @@ Rails.application.configure do |
|
|
|
|
|
|
|
# Raise error when a before_action's only/except options reference missing actions |
|
|
|
config.action_controller.raise_on_missing_callback_actions = true |
|
|
|
|
|
|
|
# Colorful Simple Logger Formatter |
|
|
|
config.log_formatter = ColoredFormatter.new |
|
|
|
end |