annotate config/environments/development.rb @ 504:aaf58c17694b

Move out custom application config
author nanaya <me@nanaya.net>
date Mon, 16 Dec 2024 01:34:05 +0900
parents 92929378413e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
481
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
1 require "active_support/core_ext/integer/time"
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
2
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
3 Rails.application.configure do
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
4 # Settings specified here will take precedence over those in config/application.rb.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
5
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
6 # Make code changes take effect immediately without server restart.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
7 config.enable_reloading = true
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
8
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
9 # Do not eager load code on boot.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
10 config.eager_load = false
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
11
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
12 # Show full error reports.
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
13 config.consider_all_requests_local = true
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
14
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
15 # Enable server timing.
485
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
16 config.server_timing = true
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
17
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
18 # Enable/disable Action Controller caching. By default Action Controller caching is disabled.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
19 # Run rails dev:cache to toggle Action Controller caching.
485
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
20 if Rails.root.join("tmp/caching-dev.txt").exist?
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
21 config.action_controller.perform_caching = true
467
fd3078b4d355 Update to latest rails
nanaya <me@nanaya.pro>
parents: 459
diff changeset
22 config.action_controller.enable_fragment_cache_logging = true
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
23 config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
24 else
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
25 config.action_controller.perform_caching = false
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
26 end
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
27
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
28 # Change to :null_store to avoid any caching.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
29 config.cache_store = :memory_store
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
30
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
31 # Print deprecation notices to the Rails logger.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
32 config.active_support.deprecation = :log
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
33
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
34 # Raise an error on page load if there are pending migrations.
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
35 config.active_record.migration_error = :page_load
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
36
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
37 # Highlight code that triggered database queries in logs.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
38 config.active_record.verbose_query_logs = true
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
39
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
40 # Append comments with runtime information tags to SQL queries in logs.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
41 config.active_record.query_log_tags_enabled = true
437
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 431
diff changeset
42
467
fd3078b4d355 Update to latest rails
nanaya <me@nanaya.pro>
parents: 459
diff changeset
43 # Raises error for missing translations.
481
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
44 # config.i18n.raise_on_missing_translations = true
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
45
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
46 # Annotate rendered view with file names.
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
47 config.action_view.annotate_rendered_view_with_filenames = true
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
48
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
49 # Raise error when a before_action's only/except options reference missing actions.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
50 config.action_controller.raise_on_missing_callback_actions = true
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
51 end