annotate config/environments/development.rb @ 485:6cac8fcf8164

Update to rails 7 (and ruby 3.1)
author nanaya <me@nanaya.pro>
date Sat, 15 Jan 2022 02:07:02 +0900
parents 88fd5722fcb3
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
481
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
6 # In the development environment your application's code is reloaded any time
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
7 # it changes. This slows down response time but is perfect for development
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
8 # since you don't have to restart the web server when you make code changes.
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
9 config.cache_classes = false
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
10
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
11 # 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
12 config.eager_load = false
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
13
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
14 # Show full error reports.
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
15 config.consider_all_requests_local = true
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
16
485
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
17 # Enable server timing
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
18 config.server_timing = true
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
19
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
20 # Enable/disable caching. By default caching is disabled.
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
21 # Run rails dev:cache to toggle caching.
485
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
22 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
23 config.action_controller.perform_caching = true
467
fd3078b4d355 Update to latest rails
nanaya <me@nanaya.pro>
parents: 459
diff changeset
24 config.action_controller.enable_fragment_cache_logging = true
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
25
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
26 config.cache_store = :memory_store
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
27 config.public_file_server.headers = {
485
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
28 "Cache-Control" => "public, max-age=#{2.days.to_i}"
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
29 }
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
30 else
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
31 config.action_controller.perform_caching = false
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
32
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
33 config.cache_store = :null_store
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
34 end
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
35
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 201
diff changeset
36 # Print deprecation notices to the Rails logger.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
37 config.active_support.deprecation = :log
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
38
481
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
39 # Raise exceptions for disallowed deprecations.
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
40 config.active_support.disallowed_deprecation = :raise
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
41
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
42 # Tell Active Support which deprecation messages to disallow.
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
43 config.active_support.disallowed_deprecation_warnings = []
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
44
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 205
diff changeset
45 # 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
46 config.active_record.migration_error = :page_load
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
47
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
48 # 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
49 config.active_record.verbose_query_logs = true
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents: 437
diff changeset
50
437
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 431
diff changeset
51 # Suppress logger output for asset requests.
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 431
diff changeset
52 config.assets.quiet = true
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 431
diff changeset
53
467
fd3078b4d355 Update to latest rails
nanaya <me@nanaya.pro>
parents: 459
diff changeset
54 # Raises error for missing translations.
481
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
55 # config.i18n.raise_on_missing_translations = true
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
56
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
57 # Annotate rendered view with file names.
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
58 # 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
59
481
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
60 # Uncomment if you wish to allow Action Cable access from any origin.
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
61 # config.action_cable.disable_request_forgery_protection = true
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
62 end