-
Notifications
You must be signed in to change notification settings - Fork 22k
Description
Because new_framework_defaults is in an initializer, it overwrites any settings in the environment files. The result is that changing a setting in an environment file might have no effect. I think this is bad because
- it is confusing for someone who doesn't realize that the setting is configured in new_framework_defaults. (this just happened to me)
- conceptually it seems more appropriate to put the future framework defaults "between" the current framework and the app's configuration. This way
- they are truly setting what the application environment config experiences as a default
- if the new_framework_defaults are never modified, the app environment config can be seamlessly carried from the current framework version to the next one and have the same meaning. with the initializer approach, when moving to the next framework version those settings will have to either be moved into environment files or into other initializer files. (if they are moved into new_framework_defaults on the new app, which now also has new new framework defaults, then the file will be a mess that doesn't actually reflect the defaults of the current and future version).
Backing up a little: The way it is now, new_framework_defaults is simply just one more, final config file that happens to have things related to the future framework. since all these settings can be changed by the user, and a user typically changes such settings in the environment config, maybe instead of having a standalone initializer it should just be dumped into application.rb with comments about what the values are for present and future rails versions. Then the user can modify it as needed and the config will be portable to the next version.