-
Notifications
You must be signed in to change notification settings - Fork 900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use rails deprecation behavior but log in production #18847
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,8 +60,12 @@ | |
# the I18n.default_locale when a translation can not be found) | ||
config.i18n.fallbacks = [I18n.default_locale] | ||
|
||
# Send deprecation notices to registered listeners | ||
config.active_support.deprecation = :notify | ||
# Send deprecation notices to registered listeners. | ||
# config.active_support.deprecation = :notify | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does a vanilla production.rb have both lines, but one commented out? If not, then I would think we'd just delete this line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. I left it because the comment is wrong with this line saying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I drop the the line that ships with rails, I should drop the comment too. They should stay or go together. |
||
|
||
# Change from rails :notify default since it's unlikely we'll have users setup | ||
# notifications for deprecation warnings. | ||
config.active_support.deprecation = :log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the 🍖 of the PR. The default of notify is great when hosted as you can setup notifications for these. Since most of our users are not hosted by us, it will be unlikely we'll ever get deprecations reported to us unless we get them by default from logging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure...see my comment below. What does this solve that we couldn't do previously? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deprecations, especially rails ones, should be exceptional. I'd like to stay on top of them so future upgrades are easier. Note, this doesn't affect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we have a lot of code suppressing the notifications in production? At least for our own deprecations. UPDATE: ugh, you just said that |
||
|
||
# Log the query plan for queries taking more than this (works | ||
# with SQLite, MySQL, and PostgreSQL) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ | |
config.cache_classes = true | ||
config.eager_load = false | ||
|
||
# Print deprecation notices to the stderr | ||
#ActiveSupport::Deprecation.behavior = :stderr | ||
# Print deprecation notices to the stderr. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, extremely important! |
||
config.active_support.deprecation = :stderr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the syntax for this to the defaults from rails. |
||
|
||
# Configure static asset server for tests with Cache-Control for performance | ||
config.public_file_server.enabled = true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man, this line is SUPER important!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Period.