All the code in the `bin/` and the `config/` folders has been generated
running `rake app:update`. The only exception is the code in
`config/application.rb` where we've excluded the engines that Rails 6.0
has added, since we don't use them.
There are a few changes in Active Storage which aren't compatible with
the code we were using until now.
Since the method to assign an attachment in ActiveStorage has changed
and is incompatible with the hack we used to allow assigning `nil`
attachments, and since ActiveStorage now supports assigning `nil`
attachments, we're removing the mentioned hack. This makes the
HasAttachment module redundant, so we're removing it.
Another change in ActiveStorage is files are no longer saved before
saving the `ActiveStorage::Attachment` record. This means we need to
manually upload the file when using direct uploads. We also have to
change the width and height validations we used for images; however,
doing so results in very complex code, and we currently have to write
that code for both images and site customization images.
So, for now, we're just uploading the file before checking its
dimensions. Not ideal, though. We might use active_storage_validations
in the future to fix this issue (when they support a proc/lambda, as
mentioned in commit 600f5c35e).
We also need to update a couple of tests due to a small change in
response headers. Now the content disposition returns something like:
```
attachment; filename="budget_investments.csv"; filename*=UTF-8''budget_investments.csv
```
So we're updating regular expression we use to check the filename.
Finally, Rails 6.0.1 changed the way the host is set in integration
tests [1] and so both `Capybara.app_host` and `Capybara.default_host`
were ignored when generating URLs in the relationable examples. The only
way I've found to make it work is to explicitely assign the host to the
integration session. Rails 6.1 will change this setup again, so maybe
then we can remove this hack.
[1] https://github.com/rails/rails/pull/36283/commits/fe00711e9
46 lines
2.5 KiB
Ruby
46 lines
2.5 KiB
Ruby
# Be sure to restart your server when you modify this file.
|
|
#
|
|
# This file contains migration options to ease your Rails 6.0 upgrade.
|
|
#
|
|
# Once upgraded flip defaults one by one to migrate to the new default.
|
|
#
|
|
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
|
|
|
# Don't force requests from old versions of IE to be UTF-8 encoded.
|
|
# Rails.application.config.action_view.default_enforce_utf8 = false
|
|
|
|
# Embed purpose and expiry metadata inside signed and encrypted
|
|
# cookies for increased security.
|
|
#
|
|
# This option is not backwards compatible with earlier Rails versions.
|
|
# It's best enabled when your entire app is migrated and stable on 6.0.
|
|
# Rails.application.config.action_dispatch.use_cookies_with_metadata = true
|
|
|
|
# Change the return value of `ActionDispatch::Response#content_type` to Content-Type header without modification.
|
|
# Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false
|
|
|
|
# Return false instead of self when enqueuing is aborted from a callback.
|
|
# Rails.application.config.active_job.return_false_on_aborted_enqueue = true
|
|
|
|
# Send Active Storage analysis and purge jobs to dedicated queues.
|
|
# Rails.application.config.active_storage.queues.analysis = :active_storage_analysis
|
|
# Rails.application.config.active_storage.queues.purge = :active_storage_purge
|
|
|
|
# When assigning to a collection of attachments declared via `has_many_attached`, replace existing
|
|
# attachments instead of appending. Use #attach to add new attachments without replacing existing ones.
|
|
# Rails.application.config.active_storage.replace_on_assign_to_many = true
|
|
|
|
# Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail.
|
|
#
|
|
# The default delivery jobs (ActionMailer::Parameterized::DeliveryJob, ActionMailer::DeliveryJob),
|
|
# will be removed in Rails 6.1. This setting is not backwards compatible with earlier Rails versions.
|
|
# If you send mail in the background, job workers need to have a copy of
|
|
# MailDeliveryJob to ensure all delivery jobs are processed properly.
|
|
# Make sure your entire app is migrated and stable on 6.0 before using this setting.
|
|
# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"
|
|
|
|
# Enable the same cache key to be reused when the object being cached of type
|
|
# `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count)
|
|
# of the relation's cache key into the cache version to support recycling cache key.
|
|
# Rails.application.config.active_record.collection_cache_versioning = true
|