aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-04-23 14:37:46 -0400
committerGitHub <noreply@github.com>2019-04-23 14:37:46 -0400
commit5566b4a63672d1a7c47476d48fe3cb91594e20b7 (patch)
tree82ff64ef95f3074884806ae73e028a2d1d74affc /railties/lib/rails
parent0920213cd5f112181a93966425267e240b96f125 (diff)
parentd63f9383a6dabfaffbb464409ed94b8d77f12a4f (diff)
downloadrails-5566b4a63672d1a7c47476d48fe3cb91594e20b7.tar.gz
rails-5566b4a63672d1a7c47476d48fe3cb91594e20b7.tar.bz2
rails-5566b4a63672d1a7c47476d48fe3cb91594e20b7.zip
Merge pull request #36067 from st0012/update-generator-for-api-app
Remove action_controller.perform_caching from api app's configs
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt2
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt2
2 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
index 2887bc2d67..404ab8b5de 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
+++ b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
@@ -15,9 +15,11 @@ 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?
+ <%- unless options.api? -%>
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
+ <%- end -%>
config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}"
diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
index ed1cf09eeb..08d437a0be 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
+++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
@@ -12,7 +12,9 @@ Rails.application.configure do
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
+ <%- unless options.api? -%>
config.action_controller.perform_caching = true
+ <%- end -%>
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).