Skip to content

Commit c6a7202

Browse files
pirjandyw8
andcommitted
Add a guideline to load config defaults
Not loading the defaults will set you back on important Rails framework defaults, e.g.: - action_view.default_enforce_utf8 - action_controller.default_protect_from_forgery - active_record.belongs_to_required_by_default and is sometimes hard to notice. https://guides.rubyonrails.org/configuring.html#results-of-config-load-defaults Fixes #277 Co-authored-by: Andy Waite <andyw8@users.noreply.github.com>
1 parent cd6da97 commit c6a7202

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ config.assets.precompile += %w( rails_admin/rails_admin.css rails_admin/rails_ad
9999

100100
Keep configuration that's applicable to all environments in the `config/application.rb` file.
101101

102+
=== Load Rails Config Defaults [[config-defaults]]
103+
104+
When upgrading to a newer Rails version, your application's configuration setting will remain on the previous version. To take advantage of the latest recommended Rails practices, the `config.load_defaults` setting should match your Rails version.
105+
106+
[source,ruby]
107+
----
108+
# good
109+
config.load_defaults 6.1
110+
----
111+
102112
=== Staging Like Prod [[staging-like-prod]]
103113

104114
Create an additional `staging` environment that closely resembles the `production` one.

0 commit comments

Comments
 (0)