mirror of https://github.com/rails/rails
Start Rails 7.1 development
This commit is contained in:
parent
8821577113
commit
83d85b2207
108
Gemfile.lock
108
Gemfile.lock
|
@ -24,82 +24,82 @@ GIT
|
||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
actioncable (7.0.0.alpha2)
|
actioncable (7.1.0.alpha)
|
||||||
actionpack (= 7.0.0.alpha2)
|
actionpack (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (7.0.0.alpha2)
|
actionmailbox (7.1.0.alpha)
|
||||||
actionpack (= 7.0.0.alpha2)
|
actionpack (= 7.1.0.alpha)
|
||||||
activejob (= 7.0.0.alpha2)
|
activejob (= 7.1.0.alpha)
|
||||||
activerecord (= 7.0.0.alpha2)
|
activerecord (= 7.1.0.alpha)
|
||||||
activestorage (= 7.0.0.alpha2)
|
activestorage (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
actionmailer (7.0.0.alpha2)
|
actionmailer (7.1.0.alpha)
|
||||||
actionpack (= 7.0.0.alpha2)
|
actionpack (= 7.1.0.alpha)
|
||||||
actionview (= 7.0.0.alpha2)
|
actionview (= 7.1.0.alpha)
|
||||||
activejob (= 7.0.0.alpha2)
|
activejob (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (7.0.0.alpha2)
|
actionpack (7.1.0.alpha)
|
||||||
actionview (= 7.0.0.alpha2)
|
actionview (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
rack (~> 2.0, >= 2.2.0)
|
rack (~> 2.0, >= 2.2.0)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actiontext (7.0.0.alpha2)
|
actiontext (7.1.0.alpha)
|
||||||
actionpack (= 7.0.0.alpha2)
|
actionpack (= 7.1.0.alpha)
|
||||||
activerecord (= 7.0.0.alpha2)
|
activerecord (= 7.1.0.alpha)
|
||||||
activestorage (= 7.0.0.alpha2)
|
activestorage (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
globalid (>= 0.6.0)
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (7.0.0.alpha2)
|
actionview (7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||||
activejob (7.0.0.alpha2)
|
activejob (7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.0.0.alpha2)
|
activemodel (7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
activerecord (7.0.0.alpha2)
|
activerecord (7.1.0.alpha)
|
||||||
activemodel (= 7.0.0.alpha2)
|
activemodel (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
activestorage (7.0.0.alpha2)
|
activestorage (7.1.0.alpha)
|
||||||
actionpack (= 7.0.0.alpha2)
|
actionpack (= 7.1.0.alpha)
|
||||||
activejob (= 7.0.0.alpha2)
|
activejob (= 7.1.0.alpha)
|
||||||
activerecord (= 7.0.0.alpha2)
|
activerecord (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
mini_mime (>= 1.1.0)
|
mini_mime (>= 1.1.0)
|
||||||
activesupport (7.0.0.alpha2)
|
activesupport (7.1.0.alpha)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
rails (7.0.0.alpha2)
|
rails (7.1.0.alpha)
|
||||||
actioncable (= 7.0.0.alpha2)
|
actioncable (= 7.1.0.alpha)
|
||||||
actionmailbox (= 7.0.0.alpha2)
|
actionmailbox (= 7.1.0.alpha)
|
||||||
actionmailer (= 7.0.0.alpha2)
|
actionmailer (= 7.1.0.alpha)
|
||||||
actionpack (= 7.0.0.alpha2)
|
actionpack (= 7.1.0.alpha)
|
||||||
actiontext (= 7.0.0.alpha2)
|
actiontext (= 7.1.0.alpha)
|
||||||
actionview (= 7.0.0.alpha2)
|
actionview (= 7.1.0.alpha)
|
||||||
activejob (= 7.0.0.alpha2)
|
activejob (= 7.1.0.alpha)
|
||||||
activemodel (= 7.0.0.alpha2)
|
activemodel (= 7.1.0.alpha)
|
||||||
activerecord (= 7.0.0.alpha2)
|
activerecord (= 7.1.0.alpha)
|
||||||
activestorage (= 7.0.0.alpha2)
|
activestorage (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 7.0.0.alpha2)
|
railties (= 7.1.0.alpha)
|
||||||
railties (7.0.0.alpha2)
|
railties (7.1.0.alpha)
|
||||||
actionpack (= 7.0.0.alpha2)
|
actionpack (= 7.1.0.alpha)
|
||||||
activesupport (= 7.0.0.alpha2)
|
activesupport (= 7.1.0.alpha)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
|
@ -245,7 +245,7 @@ GEM
|
||||||
fugit (1.5.0)
|
fugit (1.5.0)
|
||||||
et-orbi (~> 1.1, >= 1.1.8)
|
et-orbi (~> 1.1, >= 1.1.8)
|
||||||
raabro (~> 1.4)
|
raabro (~> 1.4)
|
||||||
globalid (0.6.0)
|
globalid (1.0.0)
|
||||||
activesupport (>= 5.0)
|
activesupport (>= 5.0)
|
||||||
google-apis-core (0.3.0)
|
google-apis-core (0.3.0)
|
||||||
addressable (~> 2.5, >= 2.5.1)
|
addressable (~> 2.5, >= 2.5.1)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
7.0.0.alpha2
|
7.1.0.alpha
|
||||||
|
|
|
@ -1,54 +1,3 @@
|
||||||
* The Action Cable client now ensures successful channel subscriptions:
|
|
||||||
|
|
||||||
* The client maintains a set of pending subscriptions until either
|
|
||||||
the server confirms the subscription or the channel is torn down.
|
|
||||||
* Rectifies the race condition where an unsubscribe is rapidly followed
|
|
||||||
by a subscribe (on the same channel identifier) and the requests are
|
|
||||||
handled out of order by the ActionCable server, thereby ignoring the
|
|
||||||
subscribe command.
|
|
||||||
|
|
||||||
*Daniel Spinosa*
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actioncable/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Compile ESM package that can be used directly in the browser as actioncable.esm.js.
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
* Move action_cable.js to actioncable.js to match naming convention used for other Rails frameworks, and use JS console to communicate the deprecation.
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
* Stop transpiling the UMD package generated as actioncable.js and drop the IE11 testing that relied on that.
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
* Truncate broadcast logging messages.
|
|
||||||
|
|
||||||
*J Smith*
|
|
||||||
|
|
||||||
* OpenSSL constants are now used for Digest computations.
|
|
||||||
|
|
||||||
*Dirkjan Bussink*
|
|
||||||
|
|
||||||
* The Action Cable client now includes safeguards to prevent a "thundering
|
|
||||||
herd" of client reconnects after server connectivity loss:
|
|
||||||
|
|
||||||
* The client will wait a random amount between 1x and 3x of the stale
|
|
||||||
threshold after the server's last ping before making the first
|
|
||||||
reconnection attempt.
|
|
||||||
* Subsequent reconnection attempts now use exponential backoff instead of
|
|
||||||
logarithmic backoff. To allow the delay between reconnection attempts to
|
|
||||||
increase slowly at first, the default exponentiation base is < 2.
|
|
||||||
* Random jitter is applied to each delay between reconnection attempts.
|
|
||||||
|
|
||||||
*Jonathan Hefner*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actioncable/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActionCable
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@rails/actioncable",
|
"name": "@rails/actioncable",
|
||||||
"version": "7.0.0-alpha2",
|
"version": "7.1.0-alpha",
|
||||||
"description": "WebSocket framework for Ruby on Rails.",
|
"description": "WebSocket framework for Ruby on Rails.",
|
||||||
"module": "app/assets/javascripts/actioncable.esm.js",
|
"module": "app/assets/javascripts/actioncable.esm.js",
|
||||||
"main": "app/assets/javascripts/actioncable.js",
|
"main": "app/assets/javascripts/actioncable.js",
|
||||||
|
|
|
@ -1,54 +1,3 @@
|
||||||
* Removed deprecated environment variable `MAILGUN_INGRESS_API_KEY`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Removed deprecated `Rails.application.credentials.action_mailbox.mailgun_api_key`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actionmailbox/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Add `attachments` to the list of permitted parameters for inbound emails conductor.
|
|
||||||
|
|
||||||
When using the conductor to test inbound emails with attachments, this prevents an
|
|
||||||
unpermitted parameter warning in default configurations, and prevents errors for
|
|
||||||
applications that set:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
config.action_controller.action_on_unpermitted_parameters = :raise
|
|
||||||
```
|
|
||||||
|
|
||||||
*David Jones*, *Dana Henke*
|
|
||||||
|
|
||||||
* Add ability to configure ActiveStorage service
|
|
||||||
for storing email raw source.
|
|
||||||
|
|
||||||
```yml
|
|
||||||
# config/storage.yml
|
|
||||||
incoming_emails:
|
|
||||||
service: Disk
|
|
||||||
root: /secure/dir/for/emails/only
|
|
||||||
```
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
config.action_mailbox.storage_service = :incoming_emails
|
|
||||||
```
|
|
||||||
|
|
||||||
*Yurii Rashkovskii*
|
|
||||||
|
|
||||||
* Add ability to incinerate an inbound message through the conductor interface.
|
|
||||||
|
|
||||||
*Santiago Bartesaghi*
|
|
||||||
|
|
||||||
* OpenSSL constants are now used for Digest computations.
|
|
||||||
|
|
||||||
*Dirkjan Bussink*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionmailbox/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActionMailbox
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ Bundler.require(*Rails.groups)
|
||||||
module Dummy
|
module Dummy
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
# Initialize configuration defaults for originally generated Rails version.
|
# Initialize configuration defaults for originally generated Rails version.
|
||||||
config.load_defaults 7.0
|
config.load_defaults 7.1
|
||||||
|
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
# Application configuration can go into files in config/initializers
|
# Application configuration can go into files in config/initializers
|
||||||
|
|
|
@ -1,23 +1,3 @@
|
||||||
* Remove deprecated `ActionMailer::DeliveryJob` and `ActionMailer::Parameterized::DeliveryJob`
|
|
||||||
in favor of `ActionMailer::MailDeliveryJob`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* `email_address_with_name` returns just the address if name is blank.
|
|
||||||
|
|
||||||
*Thomas Hutterer*
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actionmailer/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Configures a default of 5 for both `open_timeout` and `read_timeout` for SMTP Settings.
|
|
||||||
|
|
||||||
*André Luis Leal Cardoso Junior*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionmailer/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActionMailer
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,337 +1,3 @@
|
||||||
* `Rails.application.executor` hooks can now be called around every request in a `ActionController::TestCase`
|
|
||||||
|
|
||||||
This helps to better simulate request or job local state being reset between requests and prevent state
|
|
||||||
leaking from one request to another.
|
|
||||||
|
|
||||||
To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actionpack/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Consider onion services secure for cookies.
|
|
||||||
|
|
||||||
*Justin Tracey*
|
|
||||||
|
|
||||||
* Remove deprecated `Rails.config.action_view.raise_on_missing_translations`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated support to passing a path to `fixture_file_upload` relative to `fixture_path`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `ActionDispatch::SystemTestCase#host!`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `Rails.config.action_dispatch.hosts_response_app`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `ActionDispatch::Response.return_only_media_type_on_content_type`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Raise `ActionController::Redirecting::UnsafeRedirectError` for unsafe `redirect_to` redirects.
|
|
||||||
|
|
||||||
This allows `rescue_from` to be used to add a default fallback route:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
rescue_from ActionController::Redirecting::UnsafeRedirectError do
|
|
||||||
redirect_to root_url
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
*Kasper Timm Hansen*, *Chris Oliver*
|
|
||||||
|
|
||||||
* Add `url_from` to verify a redirect location is internal.
|
|
||||||
|
|
||||||
Takes the open redirect protection from `redirect_to` so users can wrap a
|
|
||||||
param, and fall back to an alternate redirect URL when the param provided
|
|
||||||
one is unsafe.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
def create
|
|
||||||
redirect_to url_from(params[:redirect_url]) || root_url
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
*dmcge*, *Kasper Timm Hansen*
|
|
||||||
|
|
||||||
* Allow Capybara driver name overrides in `SystemTestCase::driven_by`
|
|
||||||
|
|
||||||
Allow users to prevent conflicts among drivers that use the same driver
|
|
||||||
type (selenium, poltergeist, webkit, rack test).
|
|
||||||
|
|
||||||
Fixes #42502
|
|
||||||
|
|
||||||
*Chris LaRose*
|
|
||||||
|
|
||||||
* Allow multiline to be passed in routes when using wildcard segments.
|
|
||||||
|
|
||||||
Previously routes with newlines weren't detected when using wildcard segments, returning
|
|
||||||
a `No route matches` error.
|
|
||||||
After this change, routes with newlines are detected on wildcard segments. Example
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
draw do
|
|
||||||
get "/wildcard/*wildcard_segment", to: SimpleApp.new("foo#index"), as: :wildcard
|
|
||||||
end
|
|
||||||
|
|
||||||
# After the change, the path matches.
|
|
||||||
assert_equal "/wildcard/a%0Anewline", url_helpers.wildcard_path(wildcard_segment: "a\nnewline")
|
|
||||||
```
|
|
||||||
|
|
||||||
Fixes #39103
|
|
||||||
|
|
||||||
*Ignacio Chiazzo*
|
|
||||||
|
|
||||||
* Treat html suffix in controller translation.
|
|
||||||
|
|
||||||
*Rui Onodera*, *Gavin Miller*
|
|
||||||
|
|
||||||
* Allow permitting numeric params.
|
|
||||||
|
|
||||||
Previously it was impossible to permit different fields on numeric parameters.
|
|
||||||
After this change you can specify different fields for each numbered parameter.
|
|
||||||
For example params like,
|
|
||||||
```ruby
|
|
||||||
book: {
|
|
||||||
authors_attributes: {
|
|
||||||
'0': { name: "William Shakespeare", age_of_death: "52" },
|
|
||||||
'1': { name: "Unattributed Assistant" },
|
|
||||||
'2': "Not a hash",
|
|
||||||
'new_record': { name: "Some name" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Before you could permit name on each author with,
|
|
||||||
`permit book: { authors_attributes: [ :name ] }`
|
|
||||||
|
|
||||||
After this change you can permit different keys on each numbered element,
|
|
||||||
`permit book: { authors_attributes: { '1': [ :name ], '0': [ :name, :age_of_death ] } }`
|
|
||||||
|
|
||||||
Fixes #41625
|
|
||||||
|
|
||||||
*Adam Hess*
|
|
||||||
|
|
||||||
* Update `HostAuthorization` middleware to render debug info only
|
|
||||||
when `config.consider_all_requests_local` is set to true.
|
|
||||||
|
|
||||||
Also, blocked host info is always logged with level `error`.
|
|
||||||
|
|
||||||
Fixes #42813
|
|
||||||
|
|
||||||
*Nikita Vyrko*
|
|
||||||
|
|
||||||
* Add Server-Timing middleware
|
|
||||||
|
|
||||||
Server-Timing specification defines how the server can communicate to browsers performance metrics
|
|
||||||
about the request it is responding to.
|
|
||||||
|
|
||||||
The ServerTiming middleware is enabled by default on `development` environment by default using the
|
|
||||||
`config.server_timing` setting and set the relevant duration metrics in the `Server-Timing` header
|
|
||||||
|
|
||||||
The full specification for Server-Timing header can be found in: https://www.w3.org/TR/server-timing/#dfn-server-timing-header-field
|
|
||||||
|
|
||||||
*Sebastian Sogamoso*, *Guillermo Iguaran*
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Use a static error message when raising `ActionDispatch::Http::Parameters::ParseError`
|
|
||||||
to avoid inadvertently logging the HTTP request body at the `fatal` level when it contains
|
|
||||||
malformed JSON.
|
|
||||||
|
|
||||||
Fixes #41145
|
|
||||||
|
|
||||||
*Aaron Lahey*
|
|
||||||
|
|
||||||
* Add `Middleware#delete!` to delete middleware or raise if not found.
|
|
||||||
|
|
||||||
`Middleware#delete!` works just like `Middleware#delete` but will
|
|
||||||
raise an error if the middleware isn't found.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*, *Petrik de Heus*, *Junichi Sato*
|
|
||||||
|
|
||||||
* Raise error on unpermitted open redirects.
|
|
||||||
|
|
||||||
Add `allow_other_host` options to `redirect_to`.
|
|
||||||
Opt in to this behaviour with `ActionController::Base.raise_on_open_redirects = true`.
|
|
||||||
|
|
||||||
*Gannon McGibbon*
|
|
||||||
|
|
||||||
* Deprecate `poltergeist` and `webkit` (capybara-webkit) driver registration for system testing (they will be removed in Rails 7.1). Add `cuprite` instead.
|
|
||||||
|
|
||||||
[Poltergeist](https://github.com/teampoltergeist/poltergeist) and [capybara-webkit](https://github.com/thoughtbot/capybara-webkit) are already not maintained. These usage in Rails are removed for avoiding confusing users.
|
|
||||||
|
|
||||||
[Cuprite](https://github.com/rubycdp/cuprite) is a good alternative to Poltergeist. Some guide descriptions are replaced from Poltergeist to Cuprite.
|
|
||||||
|
|
||||||
*Yusuke Iwaki*
|
|
||||||
|
|
||||||
* Exclude additional flash types from `ActionController::Base.action_methods`.
|
|
||||||
|
|
||||||
Ensures that additional flash types defined on ActionController::Base subclasses
|
|
||||||
are not listed as actions on that controller.
|
|
||||||
|
|
||||||
class MyController < ApplicationController
|
|
||||||
add_flash_types :hype
|
|
||||||
end
|
|
||||||
|
|
||||||
MyController.action_methods.include?('hype') # => false
|
|
||||||
|
|
||||||
*Gavin Morrice*
|
|
||||||
|
|
||||||
* OpenSSL constants are now used for Digest computations.
|
|
||||||
|
|
||||||
*Dirkjan Bussink*
|
|
||||||
|
|
||||||
* Remove IE6-7-8 file download related hack/fix from ActionController::DataStreaming module.
|
|
||||||
|
|
||||||
Due to the age of those versions of IE this fix is no longer relevant, more importantly it creates an edge-case for unexpected Cache-Control headers.
|
|
||||||
|
|
||||||
*Tadas Sasnauskas*
|
|
||||||
|
|
||||||
* Configuration setting to skip logging an uncaught exception backtrace when the exception is
|
|
||||||
present in `rescued_responses`.
|
|
||||||
|
|
||||||
It may be too noisy to get all backtraces logged for applications that manage uncaught
|
|
||||||
exceptions via `rescued_responses` and `exceptions_app`.
|
|
||||||
`config.action_dispatch.log_rescued_responses` (defaults to `true`) can be set to `false` in
|
|
||||||
this case, so that only exceptions not found in `rescued_responses` will be logged.
|
|
||||||
|
|
||||||
*Alexander Azarov*, *Mike Dalessio*
|
|
||||||
|
|
||||||
* Ignore file fixtures on `db:fixtures:load`.
|
|
||||||
|
|
||||||
*Kevin Sjöberg*
|
|
||||||
|
|
||||||
* Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
|
|
||||||
|
|
||||||
*Dylan Thacker-Smith*
|
|
||||||
|
|
||||||
* New `ActionController::ConditionalGet#no_store` method to set HTTP cache control `no-store` directive.
|
|
||||||
|
|
||||||
*Tadas Sasnauskas*
|
|
||||||
|
|
||||||
* Drop support for the `SERVER_ADDR` header.
|
|
||||||
|
|
||||||
Following up https://github.com/rack/rack/pull/1573 and https://github.com/rails/rails/pull/42349.
|
|
||||||
|
|
||||||
*Ricardo Díaz*
|
|
||||||
|
|
||||||
* Set session options when initializing a basic session.
|
|
||||||
|
|
||||||
*Gannon McGibbon*
|
|
||||||
|
|
||||||
* Add `cache_control: {}` option to `fresh_when` and `stale?`.
|
|
||||||
|
|
||||||
Works as a shortcut to set `response.cache_control` with the above methods.
|
|
||||||
|
|
||||||
*Jacopo Beschi*
|
|
||||||
|
|
||||||
* Writing into a disabled session will now raise an error.
|
|
||||||
|
|
||||||
Previously when no session store was set, writing into the session would silently fail.
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* Add support for 'require-trusted-types-for' and 'trusted-types' headers.
|
|
||||||
|
|
||||||
Fixes #42034.
|
|
||||||
|
|
||||||
*lfalcao*
|
|
||||||
|
|
||||||
* Remove inline styles and address basic accessibility issues on rescue templates.
|
|
||||||
|
|
||||||
*Jacob Herrington*
|
|
||||||
|
|
||||||
* Add support for 'private, no-store' Cache-Control headers.
|
|
||||||
|
|
||||||
Previously, 'no-store' was exclusive; no other directives could be specified.
|
|
||||||
|
|
||||||
*Alex Smith*
|
|
||||||
|
|
||||||
* Expand payload of `unpermitted_parameters.action_controller` instrumentation to allow subscribers to
|
|
||||||
know which controller action received unpermitted parameters.
|
|
||||||
|
|
||||||
*bbuchalter*
|
|
||||||
|
|
||||||
* Add `ActionController::Live#send_stream` that makes it more convenient to send generated streams:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
send_stream(filename: "subscribers.csv") do |stream|
|
|
||||||
stream.writeln "email_address,updated_at"
|
|
||||||
|
|
||||||
@subscribers.find_each do |subscriber|
|
|
||||||
stream.writeln [ subscriber.email_address, subscriber.updated_at ].join(",")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
* Add `ActionController::Live::Buffer#writeln` to write a line to the stream with a newline included.
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
* `ActionDispatch::Request#content_type` now returned Content-Type header as it is.
|
|
||||||
|
|
||||||
Previously, `ActionDispatch::Request#content_type` returned value does NOT contain charset part.
|
|
||||||
This behavior changed to returned Content-Type header containing charset part as it is.
|
|
||||||
|
|
||||||
If you want just MIME type, please use `ActionDispatch::Request#media_type` instead.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
request = ActionDispatch::Request.new("CONTENT_TYPE" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
|
|
||||||
request.content_type #=> "text/csv"
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
request = ActionDispatch::Request.new("Content-Type" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
|
|
||||||
request.content_type #=> "text/csv; header=present; charset=utf-16"
|
|
||||||
request.media_type #=> "text/csv"
|
|
||||||
```
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Change `ActionDispatch::Request#media_type` to return `nil` when the request don't have a `Content-Type` header.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Fix error in `ActionController::LogSubscriber` that would happen when throwing inside a controller action.
|
|
||||||
|
|
||||||
*Janko Marohnić*
|
|
||||||
|
|
||||||
* Allow anything with `#to_str` (like `Addressable::URI`) as a `redirect_to` location.
|
|
||||||
|
|
||||||
*ojab*
|
|
||||||
|
|
||||||
* Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
|
|
||||||
|
|
||||||
*Alex Robbin*
|
|
||||||
|
|
||||||
* Deprecate the ability to assign a single value to `config.action_dispatch.trusted_proxies`
|
|
||||||
as `RemoteIp` middleware behaves inconsistently depending on whether this is configured
|
|
||||||
with a single value or an enumerable.
|
|
||||||
|
|
||||||
Fixes #40772.
|
|
||||||
|
|
||||||
*Christian Sutter*
|
|
||||||
|
|
||||||
* Add `redirect_back_or_to(fallback_location, **)` as a more aesthetically pleasing version of `redirect_back fallback_location:, **`.
|
|
||||||
The old method name is retained without explicit deprecation.
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionpack/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActionPack
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,48 +1,3 @@
|
||||||
* Fix an issue with how nested lists were displayed when converting to plain text
|
|
||||||
|
|
||||||
*Matt Swanson*
|
|
||||||
|
|
||||||
* Allow passing in a custom `direct_upload_url` or `blob_url_template` to `rich_text_area_tag`.
|
|
||||||
|
|
||||||
*Lucas Mansur*
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actiontext/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Make the Action Text + Trix JavaScript and CSS available through the asset pipeline.
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
* OpenSSL constants are now used for Digest computations.
|
|
||||||
|
|
||||||
*Dirkjan Bussink*
|
|
||||||
|
|
||||||
* Add support for passing `form:` option to `rich_text_area_tag` and
|
|
||||||
`rich_text_area` helpers to specify the `<input type="hidden" form="...">`
|
|
||||||
value.
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Add `config.action_text.attachment_tag_name`, to specify the HTML tag that contains attachments.
|
|
||||||
|
|
||||||
*Mark VanLandingham*
|
|
||||||
|
|
||||||
* Expose how we render the HTML _surrounding_ rich text content as an
|
|
||||||
extensible `layouts/action_view/contents/_content.html.erb` template to
|
|
||||||
encourage user-land customizations, while retaining private API control over how
|
|
||||||
the rich text itself is rendered by `action_text/contents/_content.html.erb`
|
|
||||||
partial.
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Add `with_all_rich_text` method to eager load all rich text associations on a model at once.
|
|
||||||
|
|
||||||
*Matt Swanson*, *DHH*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actiontext/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActionText
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@rails/actiontext",
|
"name": "@rails/actiontext",
|
||||||
"version": "7.0.0-alpha2",
|
"version": "7.1.0-alpha",
|
||||||
"description": "Edit and display rich text in Rails applications",
|
"description": "Edit and display rich text in Rails applications",
|
||||||
"main": "app/javascript/actiontext/index.js",
|
"main": "app/javascript/actiontext/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -8,7 +8,7 @@ require "action_text"
|
||||||
module Dummy
|
module Dummy
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
# Initialize configuration defaults for originally generated Rails version.
|
# Initialize configuration defaults for originally generated Rails version.
|
||||||
config.load_defaults 7.0
|
config.load_defaults 7.1
|
||||||
|
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
# Application configuration can go into files in config/initializers
|
# Application configuration can go into files in config/initializers
|
||||||
|
@ -16,4 +16,3 @@ module Dummy
|
||||||
# the framework and any gems in your application.
|
# the framework and any gems in your application.
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,289 +1,3 @@
|
||||||
* Support `fields model: [@nested, @model]` the same way as `form_with model:
|
|
||||||
[@nested, @model]`.
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Infer HTTP verb `[method]` from a model or Array with model as the first
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actionview/CHANGELOG.md) for previous changes.
|
||||||
argument to `button_to` when combined with a block:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
button_to(Workshop.find(1)){ "Update" }
|
|
||||||
#=> <form method="post" action="/workshops/1" class="button_to">
|
|
||||||
#=> <input type="hidden" name="_method" value="patch" autocomplete="off" />
|
|
||||||
#=> <button type="submit">Update</button>
|
|
||||||
#=> </form>
|
|
||||||
|
|
||||||
button_to([ Workshop.find(1), Session.find(1) ]) { "Update" }
|
|
||||||
#=> <form method="post" action="/workshops/1/sessions/1" class="button_to">
|
|
||||||
#=> <input type="hidden" name="_method" value="patch" autocomplete="off" />
|
|
||||||
#=> <button type="submit">Update</button>
|
|
||||||
#=> </form>
|
|
||||||
```
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Support passing a Symbol as the first argument to `FormBuilder#button`:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
form.button(:draft, value: true)
|
|
||||||
# => <button name="post[draft]" value="true" type="submit">Create post</button>
|
|
||||||
|
|
||||||
form.button(:draft, value: true) do
|
|
||||||
content_tag(:strong, "Save as draft")
|
|
||||||
end
|
|
||||||
# => <button name="post[draft]" value="true" type="submit">
|
|
||||||
# <strong>Save as draft</strong>
|
|
||||||
# </button>
|
|
||||||
```
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Introduce the `field_name` view helper, along with the
|
|
||||||
`FormBuilder#field_name` counterpart:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
form_for @post do |f|
|
|
||||||
f.field_tag :tag, name: f.field_name(:tag, multiple: true)
|
|
||||||
# => <input type="text" name="post[tag][]">
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Execute the `ActionView::Base.field_error_proc` within the context of the
|
|
||||||
`ActionView::Base` instance:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
config.action_view.field_error_proc = proc { |html| content_tag(:div, html, class: "field_with_errors") }
|
|
||||||
```
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Add support for `button_to ..., authenticity_token: false`
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
button_to "Create", Post.new, authenticity_token: false
|
|
||||||
# => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button></form>
|
|
||||||
|
|
||||||
button_to "Create", Post.new, authenticity_token: true
|
|
||||||
# => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button><input type="hidden" name="form_token" value="abc123..." autocomplete="off" /></form>
|
|
||||||
|
|
||||||
button_to "Create", Post.new, authenticity_token: "secret"
|
|
||||||
# => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button><input type="hidden" name="form_token" value="secret" autocomplete="off" /></form>
|
|
||||||
```
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Support rendering `<form>` elements _without_ `[action]` attributes by:
|
|
||||||
|
|
||||||
* `form_with url: false` or `form_with ..., html: { action: false }`
|
|
||||||
* `form_for ..., url: false` or `form_for ..., html: { action: false }`
|
|
||||||
* `form_tag false` or `form_tag ..., action: false`
|
|
||||||
* `button_to "...", false` or `button_to(false) { ... }`
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Add `:day_format` option to `date_select`
|
|
||||||
|
|
||||||
date_select("article", "written_on", day_format: ->(day) { day.ordinalize })
|
|
||||||
# generates day options like <option value="1">1st</option>\n<option value="2">2nd</option>...
|
|
||||||
|
|
||||||
*Shunichi Ikegami*
|
|
||||||
|
|
||||||
* Allow `link_to` helper to infer link name from `Model#to_s` when it
|
|
||||||
is used with a single argument:
|
|
||||||
|
|
||||||
link_to @profile
|
|
||||||
#=> <a href="/profiles/1">Eileen</a>
|
|
||||||
|
|
||||||
This assumes the model class implements a `to_s` method like this:
|
|
||||||
|
|
||||||
class Profile < ApplicationRecord
|
|
||||||
# ...
|
|
||||||
def to_s
|
|
||||||
name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Previously you had to supply a second argument even if the `Profile`
|
|
||||||
model implemented a `#to_s` method that called the `name` method.
|
|
||||||
|
|
||||||
link_to @profile, @profile.name
|
|
||||||
#=> <a href="/profiles/1">Eileen</a>
|
|
||||||
|
|
||||||
*Olivier Lacan*
|
|
||||||
|
|
||||||
* Support svg unpaired tags for `tag` helper.
|
|
||||||
|
|
||||||
tag.svg { tag.use('href' => "#cool-icon") }
|
|
||||||
# => <svg><use href="#cool-icon"></svg>
|
|
||||||
|
|
||||||
*Oleksii Vasyliev*
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Improves the performance of ActionView::Helpers::NumberHelper formatters by avoiding the use of
|
|
||||||
exceptions as flow control.
|
|
||||||
|
|
||||||
*Mike Dalessio*
|
|
||||||
|
|
||||||
* `preload_link_tag` properly inserts `as` attributes for files with `image` MIME types, such as JPG or SVG.
|
|
||||||
|
|
||||||
*Nate Berkopec*
|
|
||||||
|
|
||||||
* Add `weekday_options_for_select` and `weekday_select` helper methods. Also adds `weekday_select` to `FormBuilder`.
|
|
||||||
|
|
||||||
*Drew Bragg*, *Dana Kashubeck*, *Kasper Timm Hansen*
|
|
||||||
|
|
||||||
* Add `caching?` helper that returns whether the current code path is being cached and `uncacheable!` to denote helper methods that can't participate in fragment caching.
|
|
||||||
|
|
||||||
*Ben Toews*, *John Hawthorn*, *Kasper Timm Hansen*, *Joel Hawksley*
|
|
||||||
|
|
||||||
* Add `include_seconds` option for `time_field`.
|
|
||||||
|
|
||||||
<%= form.time_field :foo, include_seconds: false %>
|
|
||||||
# => <input value="16:22" type="time" />
|
|
||||||
|
|
||||||
Default includes seconds:
|
|
||||||
|
|
||||||
<%= form.time_field :foo %>
|
|
||||||
# => <input value="16:22:01.440" type="time" />
|
|
||||||
|
|
||||||
This allows you to take advantage of [different rendering options](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#time_value_format) in some browsers.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Improve error messages when template file does not exist at absolute filepath.
|
|
||||||
|
|
||||||
*Ted Whang*
|
|
||||||
|
|
||||||
* Add `:country_code` option to `sms_to` for consistency with `phone_to`.
|
|
||||||
|
|
||||||
*Jonathan Hefner*
|
|
||||||
|
|
||||||
* OpenSSL constants are now used for Digest computations.
|
|
||||||
|
|
||||||
*Dirkjan Bussink*
|
|
||||||
|
|
||||||
* The `translate` helper now passes `default` values that aren't
|
|
||||||
translation keys through `I18n.translate` for interpolation.
|
|
||||||
|
|
||||||
*Jonathan Hefner*
|
|
||||||
|
|
||||||
* Adds option `extname` to `stylesheet_link_tag` to skip default
|
|
||||||
`.css` extension appended to the stylesheet path.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
stylesheet_link_tag "style.less"
|
|
||||||
# <link href="/stylesheets/style.less.scss" rel="stylesheet">
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
stylesheet_link_tag "style.less", extname: false, skip_pipeline: true, rel: "stylesheet/less"
|
|
||||||
# <link href="/stylesheets/style.less" rel="stylesheet/less">
|
|
||||||
```
|
|
||||||
|
|
||||||
*Abhay Nikam*
|
|
||||||
|
|
||||||
* Deprecate `render` locals to be assigned to instance variables.
|
|
||||||
|
|
||||||
*Petrik de Heus*
|
|
||||||
|
|
||||||
* Remove legacy default `media=screen` from `stylesheet_link_tag`.
|
|
||||||
|
|
||||||
*André Luis Leal Cardoso Junior*
|
|
||||||
|
|
||||||
* Change `ActionView::Helpers::FormBuilder#button` to transform `formmethod`
|
|
||||||
attributes into `_method="$VERB"` Form Data to enable varied same-form actions:
|
|
||||||
|
|
||||||
<%= form_with model: post, method: :put do %>
|
|
||||||
<%= form.button "Update" %>
|
|
||||||
<%= form.button "Delete", formmethod: :delete %>
|
|
||||||
<% end %>
|
|
||||||
<%# => <form action="posts/1">
|
|
||||||
=> <input type="hidden" name="_method" value="put">
|
|
||||||
=> <button type="submit">Update</button>
|
|
||||||
=> <button type="submit" formmethod="post" name="_method" value="delete">Delete</button>
|
|
||||||
=> </form>
|
|
||||||
%>
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Change `ActionView::Helpers::UrlHelper#button_to` to *always* render a
|
|
||||||
`<button>` element, regardless of whether or not the content is passed as
|
|
||||||
the first argument or as a block.
|
|
||||||
|
|
||||||
<%= button_to "Delete", post_path(@post), method: :delete %>
|
|
||||||
# => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form>
|
|
||||||
|
|
||||||
<%= button_to post_path(@post), method: :delete do %>
|
|
||||||
Delete
|
|
||||||
<% end %>
|
|
||||||
# => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form>
|
|
||||||
|
|
||||||
*Sean Doyle*, *Dusan Orlovic*
|
|
||||||
|
|
||||||
* Add `config.action_view.preload_links_header` to allow disabling of
|
|
||||||
the `Link` header being added by default when using `stylesheet_link_tag`
|
|
||||||
and `javascript_include_tag`.
|
|
||||||
|
|
||||||
*Andrew White*
|
|
||||||
|
|
||||||
* The `translate` helper now resolves `default` values when a `nil` key is
|
|
||||||
specified, instead of always returning `nil`.
|
|
||||||
|
|
||||||
*Jonathan Hefner*
|
|
||||||
|
|
||||||
* Add `config.action_view.image_loading` to configure the default value of
|
|
||||||
the `image_tag` `:loading` option.
|
|
||||||
|
|
||||||
By setting `config.action_view.image_loading = "lazy"`, an application can opt in to
|
|
||||||
lazy loading images sitewide, without changing view code.
|
|
||||||
|
|
||||||
*Jonathan Hefner*
|
|
||||||
|
|
||||||
* `ActionView::Helpers::FormBuilder#id` returns the value
|
|
||||||
of the `<form>` element's `id` attribute. With a `method` argument, returns
|
|
||||||
the `id` attribute for a form field with that name.
|
|
||||||
|
|
||||||
<%= form_for @post do |f| %>
|
|
||||||
<%# ... %>
|
|
||||||
|
|
||||||
<% content_for :sticky_footer do %>
|
|
||||||
<%= form.button(form: f.id) %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* `ActionView::Helpers::FormBuilder#field_id` returns the value generated by
|
|
||||||
the FormBuilder for the given attribute name.
|
|
||||||
|
|
||||||
<%= form_for @post do |f| %>
|
|
||||||
<%= f.label :title %>
|
|
||||||
<%= f.text_field :title, aria: { describedby: f.field_id(:title, :error) } %>
|
|
||||||
<%= tag.span("is blank", id: f.field_id(:title, :error) %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* Add `tag.attributes` to transform a Hash into HTML Attributes, ready to be
|
|
||||||
interpolated into ERB.
|
|
||||||
|
|
||||||
<input <%= tag.attributes(type: :text, aria: { label: "Search" }) %> >
|
|
||||||
# => <input type="text" aria-label="Search">
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionview/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActionView
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@rails/ujs",
|
"name": "@rails/ujs",
|
||||||
"version": "7.0.0-alpha2",
|
"version": "7.1.0-alpha",
|
||||||
"description": "Ruby on Rails unobtrusive scripting adapter",
|
"description": "Ruby on Rails unobtrusive scripting adapter",
|
||||||
"main": "lib/assets/compiled/rails-ujs.js",
|
"main": "lib/assets/compiled/rails-ujs.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -1,84 +1,3 @@
|
||||||
* Remove deprecated `:return_false_on_aborted_enqueue` option.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Deprecated `Rails.config.active_job.skip_after_callbacks_if_terminated`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Removed deprecated behavior that was not halting `after_enqueue`/`after_perform` callbacks when a
|
|
||||||
previous callback was halted with `throw :abort`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Raise an `SerializationError` in `Serializer::ModuleSerializer`
|
|
||||||
if the module name is not present.
|
|
||||||
|
|
||||||
*Veerpal Brar*
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/activejob/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Allow a job to retry indefinitely
|
|
||||||
|
|
||||||
The `attempts` parameter of the `retry_on` method now accepts the
|
|
||||||
symbol reference `:unlimited` in addition to a specific number of retry
|
|
||||||
attempts to allow a developer to specify that a job should retry
|
|
||||||
forever until it succeeds.
|
|
||||||
|
|
||||||
class MyJob < ActiveJob::Base
|
|
||||||
retry_on(AlwaysRetryException, attempts: :unlimited)
|
|
||||||
|
|
||||||
# the actual job code
|
|
||||||
end
|
|
||||||
|
|
||||||
*Daniel Morton*
|
|
||||||
|
|
||||||
* Added possibility to check on `:priority` in test helper methods
|
|
||||||
`assert_enqueued_with` and `assert_performed_with`.
|
|
||||||
|
|
||||||
*Wojciech Wnętrzak*
|
|
||||||
|
|
||||||
* OpenSSL constants are now used for Digest computations.
|
|
||||||
|
|
||||||
*Dirkjan Bussink*
|
|
||||||
|
|
||||||
* Add a Serializer for the Range class.
|
|
||||||
|
|
||||||
This should allow things like `MyJob.perform_later(range: 1..100)`.
|
|
||||||
|
|
||||||
* Communicate enqueue failures to callers of `perform_later`.
|
|
||||||
|
|
||||||
`perform_later` can now optionally take a block which will execute after
|
|
||||||
the adapter attempts to enqueue the job. The block will receive the job
|
|
||||||
instance as an argument even if the enqueue was not successful.
|
|
||||||
Additionally, `ActiveJob` adapters now have the ability to raise an
|
|
||||||
`ActiveJob::EnqueueError` which will be caught and stored in the job
|
|
||||||
instance so code attempting to enqueue jobs can inspect any raised
|
|
||||||
`EnqueueError` using the block.
|
|
||||||
|
|
||||||
MyJob.perform_later do |job|
|
|
||||||
unless job.successfully_enqueued?
|
|
||||||
if job.enqueue_error&.message == "Redis was unavailable"
|
|
||||||
# invoke some code that will retry the job after a delay
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
*Daniel Morton*
|
|
||||||
|
|
||||||
* Don't log rescuable exceptions defined with `rescue_from`.
|
|
||||||
|
|
||||||
*Hu Hailin*
|
|
||||||
|
|
||||||
* Allow `rescue_from` to rescue all exceptions.
|
|
||||||
|
|
||||||
*Adrianna Chang*, *Étienne Barrié*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activejob/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActiveJob
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,126 +1,3 @@
|
||||||
* Remove support to Marshal load Rails 5.x `ActiveModel::AttributeSet` format.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove support to Marshal and YAML load Rails 5.x error format.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated support to use `[]=` in `ActiveModel::Errors#messages`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated support to `delete` errors from `ActiveModel::Errors#messages`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated support to `clear` errors from `ActiveModel::Errors#messages`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated support concat errors to `ActiveModel::Errors#messages`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `ActiveModel::Errors#to_xml`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `ActiveModel::Errors#keys`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `ActiveModel::Errors#values`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `ActiveModel::Errors#slice!`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `ActiveModel::Errors#to_h`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated enumeration of `ActiveModel::Errors` instances as a Hash.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Clear secure password cache if password is set to `nil`
|
|
||||||
|
|
||||||
Before:
|
|
||||||
|
|
||||||
user.password = 'something'
|
|
||||||
user.password = nil
|
|
||||||
|
|
||||||
user.password # => 'something'
|
|
||||||
|
|
||||||
Now:
|
|
||||||
|
|
||||||
user.password = 'something'
|
|
||||||
user.password = nil
|
|
||||||
|
|
||||||
user.password # => nil
|
|
||||||
|
|
||||||
*Markus Doits*
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/activemodel/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
* Introduce `ActiveModel::API`.
|
|
||||||
|
|
||||||
Make `ActiveModel::API` the minimum API to talk with Action Pack and Action View.
|
|
||||||
This will allow adding more functionality to `ActiveModel::Model`.
|
|
||||||
|
|
||||||
*Petrik de Heus*, *Nathaniel Watts*
|
|
||||||
|
|
||||||
* Fix dirty check for Float::NaN and BigDecimal::NaN.
|
|
||||||
|
|
||||||
Float::NaN and BigDecimal::NaN in Ruby are [special values](https://bugs.ruby-lang.org/issues/1720)
|
|
||||||
and can't be compared with `==`.
|
|
||||||
|
|
||||||
*Marcelo Lauxen*
|
|
||||||
|
|
||||||
* Fix `to_json` for `ActiveModel::Dirty` object.
|
|
||||||
|
|
||||||
Exclude `mutations_from_database` attribute from json as it lead to recursion.
|
|
||||||
|
|
||||||
*Anil Maurya*
|
|
||||||
|
|
||||||
* Add `ActiveModel::AttributeSet#values_for_database`.
|
|
||||||
|
|
||||||
Returns attributes with values for assignment to the database.
|
|
||||||
|
|
||||||
*Chris Salzberg*
|
|
||||||
|
|
||||||
* Fix delegation in ActiveModel::Type::Registry#lookup and ActiveModel::Type.lookup.
|
|
||||||
|
|
||||||
Passing a last positional argument `{}` would be incorrectly considered as keyword argument.
|
|
||||||
|
|
||||||
*Benoit Daloze*
|
|
||||||
|
|
||||||
* Cache and re-use generated attribute methods.
|
|
||||||
|
|
||||||
Generated methods with identical implementations will now share their instruction sequences
|
|
||||||
leading to reduced memory retention, and slightly faster load time.
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* Add `in: range` parameter to `numericality` validator.
|
|
||||||
|
|
||||||
*Michal Papis*
|
|
||||||
|
|
||||||
* Add `locale` argument to `ActiveModel::Name#initialize` to be used to generate the `singular`,
|
|
||||||
`plural`, `route_key` and `singular_route_key` values.
|
|
||||||
|
|
||||||
*Lukas Pokorny*
|
|
||||||
|
|
||||||
* Make ActiveModel::Errors#inspect slimmer for readability
|
|
||||||
|
|
||||||
*lulalala*
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activemodel/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActiveModel
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -140,7 +140,7 @@ This would also define the following accessors: <tt>Product#name</tt> and
|
||||||
|
|
||||||
* Database agnostic schema management with Migrations.
|
* Database agnostic schema management with Migrations.
|
||||||
|
|
||||||
class AddSystemSettings < ActiveRecord::Migration[7.0]
|
class AddSystemSettings < ActiveRecord::Migration[7.1]
|
||||||
def up
|
def up
|
||||||
create_table :system_settings do |t|
|
create_table :system_settings do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
|
|
@ -1788,7 +1788,7 @@ module ActiveRecord
|
||||||
# The join table should not have a primary key or a model associated with it. You must manually generate the
|
# The join table should not have a primary key or a model associated with it. You must manually generate the
|
||||||
# join table with a migration such as this:
|
# join table with a migration such as this:
|
||||||
#
|
#
|
||||||
# class CreateDevelopersProjectsJoinTable < ActiveRecord::Migration[7.0]
|
# class CreateDevelopersProjectsJoinTable < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# create_join_table :developers, :projects
|
# create_join_table :developers, :projects
|
||||||
# end
|
# end
|
||||||
|
|
|
@ -282,7 +282,7 @@ module ActiveRecord
|
||||||
# Inside migration files, the +t+ object in {create_table}[rdoc-ref:SchemaStatements#create_table]
|
# Inside migration files, the +t+ object in {create_table}[rdoc-ref:SchemaStatements#create_table]
|
||||||
# is actually of this type:
|
# is actually of this type:
|
||||||
#
|
#
|
||||||
# class SomeMigration < ActiveRecord::Migration[7.0]
|
# class SomeMigration < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# create_table :foo do |t|
|
# create_table :foo do |t|
|
||||||
# puts t.class # => "ActiveRecord::ConnectionAdapters::TableDefinition"
|
# puts t.class # => "ActiveRecord::ConnectionAdapters::TableDefinition"
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActiveRecord
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,7 +20,7 @@ module ActiveRecord
|
||||||
# For example the following migration is not reversible.
|
# For example the following migration is not reversible.
|
||||||
# Rolling back this migration will raise an ActiveRecord::IrreversibleMigration error.
|
# Rolling back this migration will raise an ActiveRecord::IrreversibleMigration error.
|
||||||
#
|
#
|
||||||
# class IrreversibleMigrationExample < ActiveRecord::Migration[7.0]
|
# class IrreversibleMigrationExample < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# create_table :distributors do |t|
|
# create_table :distributors do |t|
|
||||||
# t.string :zipcode
|
# t.string :zipcode
|
||||||
|
@ -38,7 +38,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# 1. Define <tt>#up</tt> and <tt>#down</tt> methods instead of <tt>#change</tt>:
|
# 1. Define <tt>#up</tt> and <tt>#down</tt> methods instead of <tt>#change</tt>:
|
||||||
#
|
#
|
||||||
# class ReversibleMigrationExample < ActiveRecord::Migration[7.0]
|
# class ReversibleMigrationExample < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# create_table :distributors do |t|
|
# create_table :distributors do |t|
|
||||||
# t.string :zipcode
|
# t.string :zipcode
|
||||||
|
@ -63,7 +63,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# 2. Use the #reversible method in <tt>#change</tt> method:
|
# 2. Use the #reversible method in <tt>#change</tt> method:
|
||||||
#
|
#
|
||||||
# class ReversibleMigrationExample < ActiveRecord::Migration[7.0]
|
# class ReversibleMigrationExample < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# create_table :distributors do |t|
|
# create_table :distributors do |t|
|
||||||
# t.string :zipcode
|
# t.string :zipcode
|
||||||
|
@ -228,7 +228,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# Example of a simple migration:
|
# Example of a simple migration:
|
||||||
#
|
#
|
||||||
# class AddSsl < ActiveRecord::Migration[7.0]
|
# class AddSsl < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# add_column :accounts, :ssl_enabled, :boolean, default: true
|
# add_column :accounts, :ssl_enabled, :boolean, default: true
|
||||||
# end
|
# end
|
||||||
|
@ -248,7 +248,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# Example of a more complex migration that also needs to initialize data:
|
# Example of a more complex migration that also needs to initialize data:
|
||||||
#
|
#
|
||||||
# class AddSystemSettings < ActiveRecord::Migration[7.0]
|
# class AddSystemSettings < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# create_table :system_settings do |t|
|
# create_table :system_settings do |t|
|
||||||
# t.string :name
|
# t.string :name
|
||||||
|
@ -376,7 +376,7 @@ module ActiveRecord
|
||||||
# bin/rails generate migration add_fieldname_to_tablename fieldname:string
|
# bin/rails generate migration add_fieldname_to_tablename fieldname:string
|
||||||
#
|
#
|
||||||
# This will generate the file <tt>timestamp_add_fieldname_to_tablename.rb</tt>, which will look like this:
|
# This will generate the file <tt>timestamp_add_fieldname_to_tablename.rb</tt>, which will look like this:
|
||||||
# class AddFieldnameToTablename < ActiveRecord::Migration[7.0]
|
# class AddFieldnameToTablename < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# add_column :tablenames, :fieldname, :string
|
# add_column :tablenames, :fieldname, :string
|
||||||
# end
|
# end
|
||||||
|
@ -402,7 +402,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# Not all migrations change the schema. Some just fix the data:
|
# Not all migrations change the schema. Some just fix the data:
|
||||||
#
|
#
|
||||||
# class RemoveEmptyTags < ActiveRecord::Migration[7.0]
|
# class RemoveEmptyTags < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# Tag.all.each { |tag| tag.destroy if tag.pages.empty? }
|
# Tag.all.each { |tag| tag.destroy if tag.pages.empty? }
|
||||||
# end
|
# end
|
||||||
|
@ -415,7 +415,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# Others remove columns when they migrate up instead of down:
|
# Others remove columns when they migrate up instead of down:
|
||||||
#
|
#
|
||||||
# class RemoveUnnecessaryItemAttributes < ActiveRecord::Migration[7.0]
|
# class RemoveUnnecessaryItemAttributes < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# remove_column :items, :incomplete_items_count
|
# remove_column :items, :incomplete_items_count
|
||||||
# remove_column :items, :completed_items_count
|
# remove_column :items, :completed_items_count
|
||||||
|
@ -429,7 +429,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# And sometimes you need to do something in SQL not abstracted directly by migrations:
|
# And sometimes you need to do something in SQL not abstracted directly by migrations:
|
||||||
#
|
#
|
||||||
# class MakeJoinUnique < ActiveRecord::Migration[7.0]
|
# class MakeJoinUnique < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# execute "ALTER TABLE `pages_linked_pages` ADD UNIQUE `page_id_linked_page_id` (`page_id`,`linked_page_id`)"
|
# execute "ALTER TABLE `pages_linked_pages` ADD UNIQUE `page_id_linked_page_id` (`page_id`,`linked_page_id`)"
|
||||||
# end
|
# end
|
||||||
|
@ -446,7 +446,7 @@ module ActiveRecord
|
||||||
# <tt>Base#reset_column_information</tt> in order to ensure that the model has the
|
# <tt>Base#reset_column_information</tt> in order to ensure that the model has the
|
||||||
# latest column data from after the new column was added. Example:
|
# latest column data from after the new column was added. Example:
|
||||||
#
|
#
|
||||||
# class AddPeopleSalary < ActiveRecord::Migration[7.0]
|
# class AddPeopleSalary < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# add_column :people, :salary, :integer
|
# add_column :people, :salary, :integer
|
||||||
# Person.reset_column_information
|
# Person.reset_column_information
|
||||||
|
@ -504,7 +504,7 @@ module ActiveRecord
|
||||||
# To define a reversible migration, define the +change+ method in your
|
# To define a reversible migration, define the +change+ method in your
|
||||||
# migration like this:
|
# migration like this:
|
||||||
#
|
#
|
||||||
# class TenderloveMigration < ActiveRecord::Migration[7.0]
|
# class TenderloveMigration < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# create_table(:horses) do |t|
|
# create_table(:horses) do |t|
|
||||||
# t.column :content, :text
|
# t.column :content, :text
|
||||||
|
@ -534,7 +534,7 @@ module ActiveRecord
|
||||||
# can't execute inside a transaction though, and for these situations
|
# can't execute inside a transaction though, and for these situations
|
||||||
# you can turn the automatic transactions off.
|
# you can turn the automatic transactions off.
|
||||||
#
|
#
|
||||||
# class ChangeEnum < ActiveRecord::Migration[7.0]
|
# class ChangeEnum < ActiveRecord::Migration[7.1]
|
||||||
# disable_ddl_transaction!
|
# disable_ddl_transaction!
|
||||||
#
|
#
|
||||||
# def up
|
# def up
|
||||||
|
@ -698,7 +698,7 @@ module ActiveRecord
|
||||||
# and create the table 'apples' on the way up, and the reverse
|
# and create the table 'apples' on the way up, and the reverse
|
||||||
# on the way down.
|
# on the way down.
|
||||||
#
|
#
|
||||||
# class FixTLMigration < ActiveRecord::Migration[7.0]
|
# class FixTLMigration < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# revert do
|
# revert do
|
||||||
# create_table(:horses) do |t|
|
# create_table(:horses) do |t|
|
||||||
|
@ -717,7 +717,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# require_relative "20121212123456_tenderlove_migration"
|
# require_relative "20121212123456_tenderlove_migration"
|
||||||
#
|
#
|
||||||
# class FixupTLMigration < ActiveRecord::Migration[7.0]
|
# class FixupTLMigration < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# revert TenderloveMigration
|
# revert TenderloveMigration
|
||||||
#
|
#
|
||||||
|
@ -768,7 +768,7 @@ module ActiveRecord
|
||||||
# when the three columns 'first_name', 'last_name' and 'full_name' exist,
|
# when the three columns 'first_name', 'last_name' and 'full_name' exist,
|
||||||
# even when migrating down:
|
# even when migrating down:
|
||||||
#
|
#
|
||||||
# class SplitNameMigration < ActiveRecord::Migration[7.0]
|
# class SplitNameMigration < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# add_column :users, :first_name, :string
|
# add_column :users, :first_name, :string
|
||||||
# add_column :users, :last_name, :string
|
# add_column :users, :last_name, :string
|
||||||
|
@ -796,7 +796,7 @@ module ActiveRecord
|
||||||
# In the following example, the new column +published+ will be given
|
# In the following example, the new column +published+ will be given
|
||||||
# the value +true+ for all existing records.
|
# the value +true+ for all existing records.
|
||||||
#
|
#
|
||||||
# class AddPublishedToPosts < ActiveRecord::Migration[7.0]
|
# class AddPublishedToPosts < ActiveRecord::Migration[7.1]
|
||||||
# def change
|
# def change
|
||||||
# add_column :posts, :published, :boolean, default: false
|
# add_column :posts, :published, :boolean, default: false
|
||||||
# up_only do
|
# up_only do
|
||||||
|
|
|
@ -21,8 +21,8 @@ module ActiveRecord
|
||||||
# New migration functionality that will never be backward compatible should be added directly to `ActiveRecord::Migration`.
|
# New migration functionality that will never be backward compatible should be added directly to `ActiveRecord::Migration`.
|
||||||
#
|
#
|
||||||
# There are classes for each prior Rails version. Each class descends from the *next* Rails version, so:
|
# There are classes for each prior Rails version. Each class descends from the *next* Rails version, so:
|
||||||
# 6.1 < 7.0
|
# 7.0 < 7.1
|
||||||
# 5.2 < 6.0 < 6.1 < 7.0
|
# 5.2 < 6.0 < 6.1 < 7.0 < 7.1
|
||||||
#
|
#
|
||||||
# If you are introducing new migration functionality that should only apply from Rails 7 onward, then you should
|
# If you are introducing new migration functionality that should only apply from Rails 7 onward, then you should
|
||||||
# find the class that immediately precedes it (6.1), and override the relevant migration methods to undo your changes.
|
# find the class that immediately precedes it (6.1), and override the relevant migration methods to undo your changes.
|
||||||
|
@ -30,7 +30,10 @@ module ActiveRecord
|
||||||
# For example, Rails 6 added a default value for the `precision` option on datetime columns. So in this file, the `V5_2`
|
# For example, Rails 6 added a default value for the `precision` option on datetime columns. So in this file, the `V5_2`
|
||||||
# class sets the value of `precision` to `nil` if it's not explicitly provided. This way, the default value will not apply
|
# class sets the value of `precision` to `nil` if it's not explicitly provided. This way, the default value will not apply
|
||||||
# for migrations written for 5.2, but will for migrations written for 6.0.
|
# for migrations written for 5.2, but will for migrations written for 6.0.
|
||||||
V7_0 = Current
|
V7_1 = Current
|
||||||
|
|
||||||
|
class V7_0 < V7_1
|
||||||
|
end
|
||||||
|
|
||||||
class V6_1 < V7_0
|
class V6_1 < V7_0
|
||||||
class PostgreSQLCompat
|
class PostgreSQLCompat
|
||||||
|
|
|
@ -503,7 +503,7 @@ module ActiveRecord
|
||||||
# when just after creating a table you want to populate it with some default
|
# when just after creating a table you want to populate it with some default
|
||||||
# values, e.g.:
|
# values, e.g.:
|
||||||
#
|
#
|
||||||
# class CreateJobLevels < ActiveRecord::Migration[7.0]
|
# class CreateJobLevels < ActiveRecord::Migration[7.1]
|
||||||
# def up
|
# def up
|
||||||
# create_table :job_levels do |t|
|
# create_table :job_levels do |t|
|
||||||
# t.integer :id
|
# t.integer :id
|
||||||
|
|
|
@ -1,249 +1,3 @@
|
||||||
* `Add ActiveStorage::Blob.compose` to concatenate multiple blobs.
|
|
||||||
|
|
||||||
*Gannon McGibbon*
|
|
||||||
|
|
||||||
* Setting custom metadata on blobs are now persisted to remote storage.
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/activestorage/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
*joshuamsager*
|
|
||||||
|
|
||||||
* Support direct uploads to multiple services.
|
|
||||||
|
|
||||||
*Dmitry Tsepelev*
|
|
||||||
|
|
||||||
* Invalid default content types are deprecated
|
|
||||||
|
|
||||||
Blobs created with content_type `image/jpg`, `image/pjpeg`, `image/bmp`, `text/javascript` will now produce
|
|
||||||
a deprecation warning, since these are not valid content types.
|
|
||||||
|
|
||||||
These content types will be removed from the defaults in Rails 7.1.
|
|
||||||
|
|
||||||
You can set `config.active_storage.silence_invalid_content_types_warning = true` to dismiss the warning.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Emit Active Support instrumentation events from Active Storage analyzers.
|
|
||||||
|
|
||||||
Fixes #42930
|
|
||||||
|
|
||||||
*Shouichi Kamiya*
|
|
||||||
|
|
||||||
* Add support for byte range requests
|
|
||||||
|
|
||||||
*Tom Prats*
|
|
||||||
|
|
||||||
* Attachments can be deleted after their association is no longer defined.
|
|
||||||
|
|
||||||
Fixes #42514
|
|
||||||
|
|
||||||
*Don Sisco*
|
|
||||||
|
|
||||||
* Make `vips` the default variant processor for new apps.
|
|
||||||
|
|
||||||
See the upgrade guide for instructions on converting from `mini_magick` to `vips`. `mini_magick` is
|
|
||||||
not deprecated, existing apps can keep using it.
|
|
||||||
|
|
||||||
*Breno Gazzola*
|
|
||||||
|
|
||||||
* Deprecate `ActiveStorage::Current.host` in favor of `ActiveStorage::Current.url_options` which accepts
|
|
||||||
a host, protocol and port.
|
|
||||||
|
|
||||||
*Santiago Bartesaghi*
|
|
||||||
|
|
||||||
* Allow using [IAM](https://cloud.google.com/storage/docs/access-control/signed-urls) when signing URLs with GCS.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
gcs:
|
|
||||||
service: GCS
|
|
||||||
...
|
|
||||||
iam: true
|
|
||||||
```
|
|
||||||
|
|
||||||
*RRethy*
|
|
||||||
|
|
||||||
* OpenSSL constants are now used for Digest computations.
|
|
||||||
|
|
||||||
*Dirkjan Bussink*
|
|
||||||
|
|
||||||
* Deprecate `config.active_storage.replace_on_assign_to_many`. Future versions of Rails
|
|
||||||
will behave the same way as when the config is set to `true`.
|
|
||||||
|
|
||||||
*Santiago Bartesaghi*
|
|
||||||
|
|
||||||
* Remove deprecated methods: `build_after_upload`, `create_after_upload!` in favor of `create_and_upload!`,
|
|
||||||
and `service_url` in favor of `url`.
|
|
||||||
|
|
||||||
*Santiago Bartesaghi*
|
|
||||||
|
|
||||||
* Add support of `strict_loading_by_default` to `ActiveStorage::Representations` controllers.
|
|
||||||
|
|
||||||
*Anton Topchii*, *Andrew White*
|
|
||||||
|
|
||||||
* Allow to detach an attachment when record is not persisted.
|
|
||||||
|
|
||||||
*Jacopo Beschi*
|
|
||||||
|
|
||||||
* Use libvips instead of ImageMagick to analyze images when `active_storage.variant_processor = vips`.
|
|
||||||
|
|
||||||
*Breno Gazzola*
|
|
||||||
|
|
||||||
* Add metadata value for presence of video channel in video blobs.
|
|
||||||
|
|
||||||
The `metadata` attribute of video blobs has a new boolean key named `video` that is set to
|
|
||||||
`true` if the file has an video channel and `false` if it doesn't.
|
|
||||||
|
|
||||||
*Breno Gazzola*
|
|
||||||
|
|
||||||
* Deprecate usage of `purge` and `purge_later` from the association extension.
|
|
||||||
|
|
||||||
*Jacopo Beschi*
|
|
||||||
|
|
||||||
* Passing extra parameters in `ActiveStorage::Blob#url` to S3 Client.
|
|
||||||
|
|
||||||
This allows calls of `ActiveStorage::Blob#url` to have more interaction with
|
|
||||||
the S3 Presigner, enabling, amongst other options, custom S3 domain URL
|
|
||||||
Generation.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
blob = ActiveStorage::Blob.last
|
|
||||||
|
|
||||||
blob.url # => https://<bucket-name>.s3.<region>.amazonaws.com/<key>
|
|
||||||
blob.url(virtual_host: true) # => # => https://<bucket-name>/<key>
|
|
||||||
```
|
|
||||||
|
|
||||||
*josegomezr*
|
|
||||||
|
|
||||||
* Allow setting a `Cache-Control` on files uploaded to GCS.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
gcs:
|
|
||||||
service: GCS
|
|
||||||
...
|
|
||||||
cache_control: "public, max-age=3600"
|
|
||||||
```
|
|
||||||
|
|
||||||
*maleblond*
|
|
||||||
|
|
||||||
* The parameters sent to `ffmpeg` for generating a video preview image are now
|
|
||||||
configurable under `config.active_storage.video_preview_arguments`.
|
|
||||||
|
|
||||||
*Brendon Muir*
|
|
||||||
|
|
||||||
* The ActiveStorage video previewer will now use scene change detection to generate
|
|
||||||
better preview images (rather than the previous default of using the first frame
|
|
||||||
of the video). This change requires FFmpeg v3.4+.
|
|
||||||
|
|
||||||
*Jonathan Hefner*
|
|
||||||
|
|
||||||
* Add support for ActiveStorage expiring URLs.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
rails_blob_path(user.avatar, disposition: "attachment", expires_in: 30.minutes)
|
|
||||||
|
|
||||||
<%= image_tag rails_blob_path(user.avatar.variant(resize: "100x100"), expires_in: 30.minutes) %>
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to set default expiration time for ActiveStorage URLs throughout your application, set `config.active_storage.urls_expire_in`.
|
|
||||||
|
|
||||||
*aki77*
|
|
||||||
|
|
||||||
* Allow to purge an attachment when record is not persisted for `has_many_attached`.
|
|
||||||
|
|
||||||
*Jacopo Beschi*
|
|
||||||
|
|
||||||
* Add `with_all_variant_records` method to eager load all variant records on an attachment at once.
|
|
||||||
`with_attached_image` scope now eager loads variant records if using variant tracking.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Add metadata value for presence of audio channel in video blobs.
|
|
||||||
|
|
||||||
The `metadata` attribute of video blobs has a new boolean key named `audio` that is set to
|
|
||||||
`true` if the file has an audio channel and `false` if it doesn't.
|
|
||||||
|
|
||||||
*Breno Gazzola*
|
|
||||||
|
|
||||||
* Adds analyzer for audio files.
|
|
||||||
|
|
||||||
*Breno Gazzola*
|
|
||||||
|
|
||||||
* Respect Active Record's primary_key_type in Active Storage migrations.
|
|
||||||
|
|
||||||
*fatkodima*
|
|
||||||
|
|
||||||
* Allow `expires_in` for ActiveStorage signed ids.
|
|
||||||
|
|
||||||
*aki77*
|
|
||||||
|
|
||||||
* Allow to purge an attachment when record is not persisted for `has_one_attached`.
|
|
||||||
|
|
||||||
*Jacopo Beschi*
|
|
||||||
|
|
||||||
* Add a load hook called `active_storage_variant_record` (providing `ActiveStorage::VariantRecord`)
|
|
||||||
to allow for overriding aspects of the `ActiveStorage::VariantRecord` class. This makes
|
|
||||||
`ActiveStorage::VariantRecord` consistent with `ActiveStorage::Blob` and `ActiveStorage::Attachment`
|
|
||||||
that already have load hooks.
|
|
||||||
|
|
||||||
*Brendon Muir*
|
|
||||||
|
|
||||||
* `ActiveStorage::PreviewError` is raised when a previewer is unable to generate a preview image.
|
|
||||||
|
|
||||||
*Alex Robbin*
|
|
||||||
|
|
||||||
* Add `ActiveStorage::Streaming` module that can be included in a controller to get access to `#send_blob_stream`,
|
|
||||||
which wraps the new `ActionController::Base#send_stream` method to stream a blob from cloud storage:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
class MyPublicBlobsController < ApplicationController
|
|
||||||
include ActiveStorage::SetBlob, ActiveStorage::Streaming
|
|
||||||
|
|
||||||
def show
|
|
||||||
http_cache_forever(public: true) do
|
|
||||||
send_blob_stream @blob, disposition: params[:disposition]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
* Add ability to use pre-defined variants.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
class User < ActiveRecord::Base
|
|
||||||
has_one_attached :avatar do |attachable|
|
|
||||||
attachable.variant :thumb, resize: "100x100"
|
|
||||||
attachable.variant :medium, resize: "300x300", monochrome: true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class Gallery < ActiveRecord::Base
|
|
||||||
has_many_attached :photos do |attachable|
|
|
||||||
attachable.variant :thumb, resize: "100x100"
|
|
||||||
attachable.variant :medium, resize: "300x300", monochrome: true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
<%= image_tag user.avatar.variant(:thumb) %>
|
|
||||||
```
|
|
||||||
|
|
||||||
*fatkodima*
|
|
||||||
|
|
||||||
* After setting `config.active_storage.resolve_model_to_route = :rails_storage_proxy`
|
|
||||||
`rails_blob_path` and `rails_representation_path` will generate proxy URLs by default.
|
|
||||||
|
|
||||||
*Ali Ismayilov*
|
|
||||||
|
|
||||||
* Declare `ActiveStorage::FixtureSet` and `ActiveStorage::FixtureSet.blob` to
|
|
||||||
improve fixture integration.
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activestorage/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActiveStorage
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@rails/activestorage",
|
"name": "@rails/activestorage",
|
||||||
"version": "7.0.0-alpha2",
|
"version": "7.1.0-alpha",
|
||||||
"description": "Attach cloud and local files in Rails applications",
|
"description": "Attach cloud and local files in Rails applications",
|
||||||
"module": "app/assets/javascripts/activestorage.esm.js",
|
"module": "app/assets/javascripts/activestorage.esm.js",
|
||||||
"main": "app/assets/javascripts/activestorage.js",
|
"main": "app/assets/javascripts/activestorage.js",
|
||||||
|
|
|
@ -15,7 +15,7 @@ Bundler.require(*Rails.groups)
|
||||||
|
|
||||||
module Dummy
|
module Dummy
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
config.load_defaults 7.0
|
config.load_defaults 7.1
|
||||||
|
|
||||||
config.active_storage.service = :local
|
config.active_storage.service = :local
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,355 +1,3 @@
|
||||||
* Document `ActiveSupport::Testing::Deprecation`.
|
|
||||||
|
|
||||||
*Sam Bostock & Sam Jordan*
|
|
||||||
|
|
||||||
* Add `Pathname#existence`.
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/activesupport/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
```ruby
|
|
||||||
Pathname.new("file").existence&.read
|
|
||||||
```
|
|
||||||
|
|
||||||
*Timo Schilling*
|
|
||||||
|
|
||||||
* Remove deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated support to use `Range#include?` to check the inclusion of a value in
|
|
||||||
a date time range is deprecated.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `URI.parser`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Remove deprecated `config.active_support.use_sha1_digests`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Invoking `Object#with_options` without a `&block` argument returns the
|
|
||||||
`ActiveSupport::OptionMerger` instance.
|
|
||||||
|
|
||||||
*Sean Doyle*
|
|
||||||
|
|
||||||
* `Rails.application.executor` hooks can now be called around every test
|
|
||||||
|
|
||||||
This helps to better simulate request or job local state being reset around tests and prevents state
|
|
||||||
leaking from one test to another.
|
|
||||||
|
|
||||||
However it requires the executor hooks executed in the test environment to be re-entrant.
|
|
||||||
|
|
||||||
To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* `ActiveSupport::DescendantsTracker` now mostly delegate to `Class#descendants` on Ruby 3.1
|
|
||||||
|
|
||||||
Ruby now provides a fast `Class#descendants` making `ActiveSupport::DescendantsTracker` mostly useless.
|
|
||||||
|
|
||||||
As a result the following methods are deprecated:
|
|
||||||
|
|
||||||
- `ActiveSupport::DescendantsTracker.direct_descendants`
|
|
||||||
- `ActiveSupport::DescendantsTracker#direct_descendants`
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* Fix the `Digest::UUID.uuid_from_hash` behavior for namespace IDs that are different from the ones defined on `Digest::UUID`.
|
|
||||||
|
|
||||||
The new behavior will be enabled by setting the
|
|
||||||
`config.active_support.use_rfc4122_namespaced_uuids` option to `true`
|
|
||||||
and is the default for new apps.
|
|
||||||
|
|
||||||
The old behavior is the default for upgraded apps and will output a
|
|
||||||
deprecation warning every time a value that is different than one of
|
|
||||||
the constants defined on the `Digest::UUID` extension is used as the
|
|
||||||
namespace ID.
|
|
||||||
|
|
||||||
*Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
|
|
||||||
|
|
||||||
* `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
|
|
||||||
and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*, *Oliver Peate*
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* `ActiveSupport::Dependencies` no longer installs a `const_missing` hook. Before this, you could push to the autoload paths and have constants autoloaded. This feature, known as the `classic` autoloader, has been removed.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* The private API of `ActiveSupport::Dependencies` has been deleted. That includes methods like `hook!`, `unhook!`, `depend_on`, `require_or_load`, `mechanism`, and many others.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
|
|
||||||
|
|
||||||
*Mike Dalessio*
|
|
||||||
|
|
||||||
* Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
|
|
||||||
|
|
||||||
Previously, if you provided a `error_handler` to `redis_cache_store`, any errors thrown by
|
|
||||||
the error handler would be rescued and logged only. Removed the `rescue` clause from `handle_exception`
|
|
||||||
to allow these to be thrown.
|
|
||||||
|
|
||||||
*Nicholas A. Stuart*
|
|
||||||
|
|
||||||
* Allow entirely opting out of deprecation warnings.
|
|
||||||
|
|
||||||
Previously if you did `app.config.active_support.deprecation = :silence`, some work would
|
|
||||||
still be done on each call to `ActiveSupport::Deprecation.warn`. In very hot paths, this could
|
|
||||||
cause performance issues.
|
|
||||||
|
|
||||||
Now, you can make `ActiveSupport::Deprecation.warn` a no-op:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
config.active_support.report_deprecations = false
|
|
||||||
```
|
|
||||||
|
|
||||||
This is the default in production for new apps. It is the equivalent to:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
config.active_support.deprecation = :silence
|
|
||||||
config.active_support.disallowed_deprecation = :silence
|
|
||||||
```
|
|
||||||
|
|
||||||
but will take a more optimised code path.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Faster tests by parallelizing only when overhead is justified by the number
|
|
||||||
of them.
|
|
||||||
|
|
||||||
Running tests in parallel adds overhead in terms of database
|
|
||||||
setup and fixture loading. Now, Rails will only parallelize test executions when
|
|
||||||
there are enough tests to make it worth it.
|
|
||||||
|
|
||||||
This threshold is 50 by default, and is configurable via config setting in
|
|
||||||
your test.rb:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
config.active_support.test_parallelization_threshold = 100
|
|
||||||
```
|
|
||||||
|
|
||||||
It's also configurable at the test case level:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
class ActiveSupport::TestCase
|
|
||||||
parallelize threshold: 100
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
*Jorge Manrubia*
|
|
||||||
|
|
||||||
* OpenSSL constants are now used for Digest computations.
|
|
||||||
|
|
||||||
*Dirkjan Bussink*
|
|
||||||
|
|
||||||
* `TimeZone.iso8601` now accepts valid ordinal values similar to Ruby's `Date._iso8601` method.
|
|
||||||
A valid ordinal value will be converted to an instance of `TimeWithZone` using the `:year`
|
|
||||||
and `:yday` fragments returned from `Date._iso8601`.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
twz = ActiveSupport::TimeZone["Eastern Time (US & Canada)"].iso8601("21087")
|
|
||||||
twz.to_a[0, 6] == [0, 0, 0, 28, 03, 2021]
|
|
||||||
```
|
|
||||||
|
|
||||||
*Steve Laing*
|
|
||||||
|
|
||||||
* `Time#change` and methods that call it (e.g. `Time#advance`) will now
|
|
||||||
return a `Time` with the timezone argument provided, if the caller was
|
|
||||||
initialized with a timezone argument.
|
|
||||||
|
|
||||||
Fixes [#42467](https://github.com/rails/rails/issues/42467).
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Allow serializing any module or class to JSON by name.
|
|
||||||
|
|
||||||
*Tyler Rick*, *Zachary Scott*
|
|
||||||
|
|
||||||
* Raise `ActiveSupport::EncryptedFile::MissingKeyError` when the
|
|
||||||
`RAILS_MASTER_KEY` environment variable is blank (e.g. `""`).
|
|
||||||
|
|
||||||
*Sunny Ripert*
|
|
||||||
|
|
||||||
* The `from:` option is added to `ActiveSupport::TestCase#assert_no_changes`.
|
|
||||||
|
|
||||||
It permits asserting on the initial value that is expected not to change.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
assert_no_changes -> { Status.all_good? }, from: true do
|
|
||||||
post :create, params: { status: { ok: true } }
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
*George Claghorn*
|
|
||||||
|
|
||||||
* Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
|
|
||||||
|
|
||||||
Except for a few methods like `String#%`, objects must implement `#to_str`
|
|
||||||
to be implicitly converted to a String in string operations. In some
|
|
||||||
circumstances `ActiveSupport::SafeBuffer` was incorrectly calling the
|
|
||||||
explicit conversion method (`#to_s`) on them. This behavior is now
|
|
||||||
deprecated.
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* Allow nested access to keys on `Rails.application.credentials`.
|
|
||||||
|
|
||||||
Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
|
|
||||||
|
|
||||||
For example, given these secrets:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
aws:
|
|
||||||
access_key_id: 123
|
|
||||||
secret_access_key: 345
|
|
||||||
```
|
|
||||||
|
|
||||||
`Rails.application.credentials.aws.access_key_id` will now return the same thing as
|
|
||||||
`Rails.application.credentials.aws[:access_key_id]`.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Added a faster and more compact `ActiveSupport::Cache` serialization format.
|
|
||||||
|
|
||||||
It can be enabled with `config.active_support.cache_format_version = 7.0` or
|
|
||||||
`config.load_defaults 7.0`. Regardless of the configuration Active Support
|
|
||||||
7.0 can read cache entries serialized by Active Support 6.1 which allows to
|
|
||||||
upgrade without invalidating the cache. However Rails 6.1 can't read the
|
|
||||||
new format, so all readers must be upgraded before the new format is enabled.
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* Add `Enumerable#sole`, per `ActiveRecord::FinderMethods#sole`. Returns the
|
|
||||||
sole item of the enumerable, raising if no items are found, or if more than
|
|
||||||
one is.
|
|
||||||
|
|
||||||
*Asherah Connor*
|
|
||||||
|
|
||||||
* Freeze `ActiveSupport::Duration#parts` and remove writer methods.
|
|
||||||
|
|
||||||
Durations are meant to be value objects and should not be mutated.
|
|
||||||
|
|
||||||
*Andrew White*
|
|
||||||
|
|
||||||
* Fix `ActiveSupport::TimeZone#utc_to_local` with fractional seconds.
|
|
||||||
|
|
||||||
When `utc_to_local_returns_utc_offset_times` is false and the time
|
|
||||||
instance had fractional seconds the new UTC time instance was out by
|
|
||||||
a factor of 1,000,000 as the `Time.utc` constructor takes a usec
|
|
||||||
value and not a fractional second value.
|
|
||||||
|
|
||||||
*Andrew White*
|
|
||||||
|
|
||||||
* Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
|
|
||||||
```
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
|
|
||||||
|
|
||||||
*Andrew White*
|
|
||||||
|
|
||||||
* Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
|
|
||||||
is considerably faster.
|
|
||||||
|
|
||||||
Ruby requires an initializer for non-numeric type as per examples below:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%w[foo bar].sum('')
|
|
||||||
# instead of %w[foo bar].sum
|
|
||||||
|
|
||||||
[[1, 2], [3, 4, 5]].sum([])
|
|
||||||
# instead of [[1, 2], [3, 4, 5]].sum
|
|
||||||
```
|
|
||||||
|
|
||||||
*Alberto Mota*
|
|
||||||
|
|
||||||
* Tests parallelization is now disabled when running individual files to prevent the setup overhead.
|
|
||||||
|
|
||||||
It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
|
|
||||||
|
|
||||||
*Ricardo Díaz*
|
|
||||||
|
|
||||||
* Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
|
|
||||||
|
|
||||||
*Marcin Kołodziej*
|
|
||||||
|
|
||||||
* Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
|
|
||||||
elements of an enumerable.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
|
|
||||||
|
|
||||||
payments.minimum(:price) # => 5
|
|
||||||
payments.maximum(:price) # => 15
|
|
||||||
```
|
|
||||||
|
|
||||||
This also allows passing enumerables to `fresh_when` and `stale?` in Action Controller.
|
|
||||||
See PR [#41404](https://github.com/rails/rails/pull/41404) for an example.
|
|
||||||
|
|
||||||
*Ayrton De Craene*
|
|
||||||
|
|
||||||
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
config.cache_store = :mem_cache_store, nil
|
|
||||||
|
|
||||||
# is now equivalent to
|
|
||||||
|
|
||||||
config.cache_store = :mem_cache_store
|
|
||||||
|
|
||||||
# and is also equivalent to
|
|
||||||
|
|
||||||
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
|
||||||
|
|
||||||
# which is the fallback behavior of Dalli
|
|
||||||
```
|
|
||||||
|
|
||||||
This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
|
|
||||||
|
|
||||||
*Michael Overmeyer*
|
|
||||||
|
|
||||||
* Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
|
|
||||||
|
|
||||||
*DHH*
|
|
||||||
|
|
||||||
* `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
|
|
||||||
`String#camelize` behavior.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
|
|
||||||
invalid.
|
|
||||||
|
|
||||||
*Vipul A M*
|
|
||||||
|
|
||||||
* `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
|
|
||||||
|
|
||||||
*Nathaniel Woodthorpe*
|
|
||||||
|
|
||||||
* Consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
|
|
||||||
|
|
||||||
*Ritikesh G*
|
|
||||||
|
|
||||||
* Add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
|
|
||||||
|
|
||||||
*Ritikesh G*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ module ActiveSupport
|
||||||
# and the second is a library name.
|
# and the second is a library name.
|
||||||
#
|
#
|
||||||
# ActiveSupport::Deprecation.new('2.0', 'MyLibrary')
|
# ActiveSupport::Deprecation.new('2.0', 'MyLibrary')
|
||||||
def initialize(deprecation_horizon = "7.1", gem_name = "Rails")
|
def initialize(deprecation_horizon = "7.2", gem_name = "Rails")
|
||||||
self.gem_name = gem_name
|
self.gem_name = gem_name
|
||||||
self.deprecation_horizon = deprecation_horizon
|
self.deprecation_horizon = deprecation_horizon
|
||||||
# By default, warnings are not silenced and debugging is off.
|
# By default, warnings are not silenced and debugging is off.
|
||||||
|
|
|
@ -8,9 +8,9 @@ module ActiveSupport
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* No changes.
|
|
||||||
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/guides/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
* The autoloading guide for `zeitwerk` mode has been revised.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* The autoloading guide for `classic` mode has been deleted.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/guides/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ end
|
||||||
class Payment < ActiveRecord::Base
|
class Payment < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
class ChangeAmountToAddScale < ActiveRecord::Migration[7.0]
|
class ChangeAmountToAddScale < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
reversible do |dir|
|
reversible do |dir|
|
||||||
dir.up do
|
dir.up do
|
||||||
|
|
|
@ -0,0 +1,184 @@
|
||||||
|
|
||||||
|
**DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON https://guides.rubyonrails.org.**
|
||||||
|
|
||||||
|
Ruby on Rails 7.1 Release Notes
|
||||||
|
===============================
|
||||||
|
|
||||||
|
Highlights in Rails 7.1:
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Upgrading to Rails 7.1
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
If you're upgrading an existing application, it's a great idea to have good test
|
||||||
|
coverage before going in. You should also first upgrade to Rails 7.0 in case you
|
||||||
|
haven't and make sure your application still runs as expected before attempting
|
||||||
|
an update to Rails 7.1. A list of things to watch out for when upgrading is
|
||||||
|
available in the
|
||||||
|
[Upgrading Ruby on Rails](upgrading_ruby_on_rails.html#upgrading-from-rails-7-0-to-rails-7-1)
|
||||||
|
guide.
|
||||||
|
|
||||||
|
Major Features
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Railties
|
||||||
|
--------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][railties] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Action Cable
|
||||||
|
------------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][action-cable] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Action Pack
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][action-pack] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Action View
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][action-view] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Action Mailer
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][action-mailer] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Active Record
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][active-record] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Active Storage
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][active-storage] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Active Model
|
||||||
|
------------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][active-model] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Active Support
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][active-support] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Active Job
|
||||||
|
----------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][active-job] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Action Text
|
||||||
|
----------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][action-text] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Action Mailbox
|
||||||
|
----------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][action-mailbox] for detailed changes.
|
||||||
|
|
||||||
|
### Removals
|
||||||
|
|
||||||
|
### Deprecations
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Ruby on Rails Guides
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
Please refer to the [Changelog][guides] for detailed changes.
|
||||||
|
|
||||||
|
### Notable changes
|
||||||
|
|
||||||
|
Credits
|
||||||
|
-------
|
||||||
|
|
||||||
|
See the
|
||||||
|
[full list of contributors to Rails](https://contributors.rubyonrails.org/)
|
||||||
|
for the many people who spent many hours making Rails, the stable and robust
|
||||||
|
framework it is. Kudos to all of them.
|
||||||
|
|
||||||
|
[railties]: https://github.com/rails/rails/blob/main/railties/CHANGELOG.md
|
||||||
|
[action-pack]: https://github.com/rails/rails/blob/main/actionpack/CHANGELOG.md
|
||||||
|
[action-view]: https://github.com/rails/rails/blob/main/actionview/CHANGELOG.md
|
||||||
|
[action-mailer]: https://github.com/rails/rails/blob/main/actionmailer/CHANGELOG.md
|
||||||
|
[action-cable]: https://github.com/rails/rails/blob/main/actioncable/CHANGELOG.md
|
||||||
|
[active-record]: https://github.com/rails/rails/blob/main/activerecord/CHANGELOG.md
|
||||||
|
[active-storage]: https://github.com/rails/rails/blob/main/activestorage/CHANGELOG.md
|
||||||
|
[active-model]: https://github.com/rails/rails/blob/main/activemodel/CHANGELOG.md
|
||||||
|
[active-support]: https://github.com/rails/rails/blob/main/activesupport/CHANGELOG.md
|
||||||
|
[active-job]: https://github.com/rails/rails/blob/main/activejob/CHANGELOG.md
|
||||||
|
[action-text]: https://github.com/rails/rails/blob/main/actiontext/CHANGELOG.md
|
||||||
|
[action-mailbox]: https://github.com/rails/rails/blob/main/actionmailbox/CHANGELOG.md
|
||||||
|
[guides]: https://github.com/rails/rails/blob/main/guides/CHANGELOG.md
|
|
@ -10,12 +10,13 @@
|
||||||
</p>
|
</p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p>
|
<p>
|
||||||
These are the new guides for Rails 7.0 based on <a href="https://github.com/rails/rails/tree/<%= @version %>"><%= @version %></a>.
|
These are the new guides for Rails 7.1 based on <a href="https://github.com/rails/rails/tree/<%= @version %>"><%= @version %></a>.
|
||||||
These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together.
|
These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together.
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<p>
|
<p>
|
||||||
The guides for earlier releases:
|
The guides for earlier releases:
|
||||||
|
<a href="https://guides.rubyonrails.org/v7.0/">Rails 7.0</a>,
|
||||||
<a href="https://guides.rubyonrails.org/v6.1/">Rails 6.1</a>,
|
<a href="https://guides.rubyonrails.org/v6.1/">Rails 6.1</a>,
|
||||||
<a href="https://guides.rubyonrails.org/v6.0/">Rails 6.0</a>,
|
<a href="https://guides.rubyonrails.org/v6.0/">Rails 6.0</a>,
|
||||||
<a href="https://guides.rubyonrails.org/v5.2/">Rails 5.2</a>,
|
<a href="https://guides.rubyonrails.org/v5.2/">Rails 5.2</a>,
|
||||||
|
|
|
@ -374,7 +374,7 @@ database that Active Record supports using `rake`. Here's a migration that
|
||||||
creates a table:
|
creates a table:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreatePublications < ActiveRecord::Migration[7.0]
|
class CreatePublications < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :publications do |t|
|
create_table :publications do |t|
|
||||||
t.string :title
|
t.string :title
|
||||||
|
|
|
@ -34,7 +34,7 @@ history to the latest version. Active Record will also update your
|
||||||
Here's an example of a migration:
|
Here's an example of a migration:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateProducts < ActiveRecord::Migration[7.0]
|
class CreateProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :products do |t|
|
create_table :products do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -71,7 +71,7 @@ If you wish for a migration to do something that Active Record doesn't know how
|
||||||
to reverse, you can use `reversible`:
|
to reverse, you can use `reversible`:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class ChangeProductsPrice < ActiveRecord::Migration[7.0]
|
class ChangeProductsPrice < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
reversible do |dir|
|
reversible do |dir|
|
||||||
change_table :products do |t|
|
change_table :products do |t|
|
||||||
|
@ -86,7 +86,7 @@ end
|
||||||
Alternatively, you can use `up` and `down` instead of `change`:
|
Alternatively, you can use `up` and `down` instead of `change`:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class ChangeProductsPrice < ActiveRecord::Migration[7.0]
|
class ChangeProductsPrice < ActiveRecord::Migration[7.1]
|
||||||
def up
|
def up
|
||||||
change_table :products do |t|
|
change_table :products do |t|
|
||||||
t.change :price, :string
|
t.change :price, :string
|
||||||
|
@ -128,7 +128,7 @@ $ bin/rails generate migration AddPartNumberToProducts
|
||||||
This will create an appropriately named empty migration:
|
This will create an appropriately named empty migration:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class AddPartNumberToProducts < ActiveRecord::Migration[7.0]
|
class AddPartNumberToProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -150,7 +150,7 @@ $ bin/rails generate migration AddPartNumberToProducts part_number:string
|
||||||
will generate
|
will generate
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class AddPartNumberToProducts < ActiveRecord::Migration[7.0]
|
class AddPartNumberToProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
add_column :products, :part_number, :string
|
add_column :products, :part_number, :string
|
||||||
end
|
end
|
||||||
|
@ -166,7 +166,7 @@ $ bin/rails generate migration AddPartNumberToProducts part_number:string:index
|
||||||
will generate the appropriate `add_column` and [`add_index`][] statements:
|
will generate the appropriate `add_column` and [`add_index`][] statements:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class AddPartNumberToProducts < ActiveRecord::Migration[7.0]
|
class AddPartNumberToProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
add_column :products, :part_number, :string
|
add_column :products, :part_number, :string
|
||||||
add_index :products, :part_number
|
add_index :products, :part_number
|
||||||
|
@ -183,7 +183,7 @@ $ bin/rails generate migration RemovePartNumberFromProducts part_number:string
|
||||||
generates
|
generates
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class RemovePartNumberFromProducts < ActiveRecord::Migration[7.0]
|
class RemovePartNumberFromProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
remove_column :products, :part_number, :string
|
remove_column :products, :part_number, :string
|
||||||
end
|
end
|
||||||
|
@ -199,7 +199,7 @@ $ bin/rails generate migration AddDetailsToProducts part_number:string price:dec
|
||||||
generates
|
generates
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class AddDetailsToProducts < ActiveRecord::Migration[7.0]
|
class AddDetailsToProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
add_column :products, :part_number, :string
|
add_column :products, :part_number, :string
|
||||||
add_column :products, :price, :decimal
|
add_column :products, :price, :decimal
|
||||||
|
@ -218,7 +218,7 @@ $ bin/rails generate migration CreateProducts name:string part_number:string
|
||||||
generates
|
generates
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateProducts < ActiveRecord::Migration[7.0]
|
class CreateProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :products do |t|
|
create_table :products do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -244,7 +244,7 @@ $ bin/rails generate migration AddUserRefToProducts user:references
|
||||||
generates the following [`add_reference`][] call:
|
generates the following [`add_reference`][] call:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class AddUserRefToProducts < ActiveRecord::Migration[7.0]
|
class AddUserRefToProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
add_reference :products, :user, foreign_key: true
|
add_reference :products, :user, foreign_key: true
|
||||||
end
|
end
|
||||||
|
@ -264,7 +264,7 @@ $ bin/rails generate migration CreateJoinTableCustomerProduct customer product
|
||||||
will produce the following migration:
|
will produce the following migration:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateJoinTableCustomerProduct < ActiveRecord::Migration[7.0]
|
class CreateJoinTableCustomerProduct < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_join_table :customers, :products do |t|
|
create_join_table :customers, :products do |t|
|
||||||
# t.index [:customer_id, :product_id]
|
# t.index [:customer_id, :product_id]
|
||||||
|
@ -293,7 +293,7 @@ $ bin/rails generate model Product name:string description:text
|
||||||
will create a migration that looks like this
|
will create a migration that looks like this
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateProducts < ActiveRecord::Migration[7.0]
|
class CreateProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :products do |t|
|
create_table :products do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -321,7 +321,7 @@ $ bin/rails generate migration AddDetailsToProducts 'price:decimal{5,2}' supplie
|
||||||
will produce a migration that looks like this
|
will produce a migration that looks like this
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class AddDetailsToProducts < ActiveRecord::Migration[7.0]
|
class AddDetailsToProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
add_column :products, :price, :decimal, precision: 5, scale: 2
|
add_column :products, :price, :decimal, precision: 5, scale: 2
|
||||||
add_reference :products, :supplier, polymorphic: true
|
add_reference :products, :supplier, polymorphic: true
|
||||||
|
@ -658,7 +658,7 @@ to reverse. You can use [`reversible`][] to specify what to do when running a
|
||||||
migration and what else to do when reverting it. For example:
|
migration and what else to do when reverting it. For example:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class ExampleMigration < ActiveRecord::Migration[7.0]
|
class ExampleMigration < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :distributors do |t|
|
create_table :distributors do |t|
|
||||||
t.string :zipcode
|
t.string :zipcode
|
||||||
|
@ -713,7 +713,7 @@ is wise to perform the transformations in precisely the reverse order they were
|
||||||
made in the `up` method. The example in the `reversible` section is equivalent to:
|
made in the `up` method. The example in the `reversible` section is equivalent to:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class ExampleMigration < ActiveRecord::Migration[7.0]
|
class ExampleMigration < ActiveRecord::Migration[7.1]
|
||||||
def up
|
def up
|
||||||
create_table :distributors do |t|
|
create_table :distributors do |t|
|
||||||
t.string :zipcode
|
t.string :zipcode
|
||||||
|
@ -756,7 +756,7 @@ You can use Active Record's ability to rollback migrations using the [`revert`][
|
||||||
```ruby
|
```ruby
|
||||||
require_relative "20121212123456_example_migration"
|
require_relative "20121212123456_example_migration"
|
||||||
|
|
||||||
class FixupExampleMigration < ActiveRecord::Migration[7.0]
|
class FixupExampleMigration < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
revert ExampleMigration
|
revert ExampleMigration
|
||||||
|
|
||||||
|
@ -774,7 +774,7 @@ is later decided it would be best to use Active Record validations,
|
||||||
in place of the `CHECK` constraint, to verify the zipcode.
|
in place of the `CHECK` constraint, to verify the zipcode.
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class DontUseConstraintForZipcodeValidationMigration < ActiveRecord::Migration[7.0]
|
class DontUseConstraintForZipcodeValidationMigration < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
revert do
|
revert do
|
||||||
# copy-pasted code from ExampleMigration
|
# copy-pasted code from ExampleMigration
|
||||||
|
@ -936,7 +936,7 @@ Several methods are provided in migrations that allow you to control all this:
|
||||||
For example, this migration:
|
For example, this migration:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateProducts < ActiveRecord::Migration[7.0]
|
class CreateProducts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
suppress_messages do
|
suppress_messages do
|
||||||
create_table :products do |t|
|
create_table :products do |t|
|
||||||
|
@ -1105,7 +1105,7 @@ to add or modify data. This is useful in an existing database that can't be dest
|
||||||
and recreated, such as a production database.
|
and recreated, such as a production database.
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class AddInitialProducts < ActiveRecord::Migration[7.0]
|
class AddInitialProducts < ActiveRecord::Migration[7.1]
|
||||||
def up
|
def up
|
||||||
5.times do |i|
|
5.times do |i|
|
||||||
Product.create(name: "Product ##{i}", description: "A product.")
|
Product.create(name: "Product ##{i}", description: "A product.")
|
||||||
|
|
|
@ -106,7 +106,7 @@ NOTE: `belongs_to` associations _must_ use the singular term. If you used the pl
|
||||||
The corresponding migration might look like this:
|
The corresponding migration might look like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateBooks < ActiveRecord::Migration[7.0]
|
class CreateBooks < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :authors do |t|
|
create_table :authors do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -153,7 +153,7 @@ The main difference from `belongs_to` is that the link column `supplier_id` is l
|
||||||
The corresponding migration might look like this:
|
The corresponding migration might look like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateSuppliers < ActiveRecord::Migration[7.0]
|
class CreateSuppliers < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :suppliers do |t|
|
create_table :suppliers do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -199,7 +199,7 @@ NOTE: The name of the other model is pluralized when declaring a `has_many` asso
|
||||||
The corresponding migration might look like this:
|
The corresponding migration might look like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateAuthors < ActiveRecord::Migration[7.0]
|
class CreateAuthors < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :authors do |t|
|
create_table :authors do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -251,7 +251,7 @@ end
|
||||||
The corresponding migration might look like this:
|
The corresponding migration might look like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateAppointments < ActiveRecord::Migration[7.0]
|
class CreateAppointments < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :physicians do |t|
|
create_table :physicians do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -337,7 +337,7 @@ end
|
||||||
The corresponding migration might look like this:
|
The corresponding migration might look like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateAccountHistories < ActiveRecord::Migration[7.0]
|
class CreateAccountHistories < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :suppliers do |t|
|
create_table :suppliers do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -380,7 +380,7 @@ end
|
||||||
The corresponding migration might look like this:
|
The corresponding migration might look like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateAssembliesAndParts < ActiveRecord::Migration[7.0]
|
class CreateAssembliesAndParts < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :assemblies do |t|
|
create_table :assemblies do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -419,7 +419,7 @@ end
|
||||||
The corresponding migration might look like this:
|
The corresponding migration might look like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateSuppliers < ActiveRecord::Migration[7.0]
|
class CreateSuppliers < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :suppliers do |t|
|
create_table :suppliers do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -501,7 +501,7 @@ Similarly, you can retrieve `@product.pictures`.
|
||||||
If you have an instance of the `Picture` model, you can get to its parent via `@picture.imageable`. To make this work, you need to declare both a foreign key column and a type column in the model that declares the polymorphic interface:
|
If you have an instance of the `Picture` model, you can get to its parent via `@picture.imageable`. To make this work, you need to declare both a foreign key column and a type column in the model that declares the polymorphic interface:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreatePictures < ActiveRecord::Migration[7.0]
|
class CreatePictures < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :pictures do |t|
|
create_table :pictures do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -518,7 +518,7 @@ end
|
||||||
This migration can be simplified by using the `t.references` form:
|
This migration can be simplified by using the `t.references` form:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreatePictures < ActiveRecord::Migration[7.0]
|
class CreatePictures < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :pictures do |t|
|
create_table :pictures do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
@ -549,7 +549,7 @@ With this setup, you can retrieve `@employee.subordinates` and `@employee.manage
|
||||||
In your migrations/schema, you will add a references column to the model itself.
|
In your migrations/schema, you will add a references column to the model itself.
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateEmployees < ActiveRecord::Migration[7.0]
|
class CreateEmployees < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :employees do |t|
|
create_table :employees do |t|
|
||||||
t.references :manager, foreign_key: { to_table: :employees }
|
t.references :manager, foreign_key: { to_table: :employees }
|
||||||
|
@ -619,7 +619,7 @@ end
|
||||||
This declaration needs to be backed up by a corresponding foreign key column in the books table. For a brand new table, the migration might look something like this:
|
This declaration needs to be backed up by a corresponding foreign key column in the books table. For a brand new table, the migration might look something like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateBooks < ActiveRecord::Migration[7.0]
|
class CreateBooks < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :books do |t|
|
create_table :books do |t|
|
||||||
t.datetime :published_at
|
t.datetime :published_at
|
||||||
|
@ -633,7 +633,7 @@ end
|
||||||
Whereas for an existing table, it might look like this:
|
Whereas for an existing table, it might look like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class AddAuthorToBooks < ActiveRecord::Migration[7.0]
|
class AddAuthorToBooks < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
add_reference :books, :author
|
add_reference :books, :author
|
||||||
end
|
end
|
||||||
|
@ -663,7 +663,7 @@ end
|
||||||
These need to be backed up by a migration to create the `assemblies_parts` table. This table should be created without a primary key:
|
These need to be backed up by a migration to create the `assemblies_parts` table. This table should be created without a primary key:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateAssembliesPartsJoinTable < ActiveRecord::Migration[7.0]
|
class CreateAssembliesPartsJoinTable < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_table :assemblies_parts, id: false do |t|
|
create_table :assemblies_parts, id: false do |t|
|
||||||
t.bigint :assembly_id
|
t.bigint :assembly_id
|
||||||
|
@ -681,7 +681,7 @@ We pass `id: false` to `create_table` because that table does not represent a mo
|
||||||
You can also use the method `create_join_table`
|
You can also use the method `create_join_table`
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class CreateAssembliesPartsJoinTable < ActiveRecord::Migration[7.0]
|
class CreateAssembliesPartsJoinTable < ActiveRecord::Migration[7.1]
|
||||||
def change
|
def change
|
||||||
create_join_table :assemblies, :parts do |t|
|
create_join_table :assemblies, :parts do |t|
|
||||||
t.index :assembly_id
|
t.index :assembly_id
|
||||||
|
|
|
@ -345,7 +345,7 @@ If you wish to test out some code without changing any data, you can do that by
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bin/rails console --sandbox
|
$ bin/rails console --sandbox
|
||||||
Loading development environment in sandbox (Rails 7.0.0)
|
Loading development environment in sandbox (Rails 7.1.0)
|
||||||
Any modifications you make will be rolled back on exit
|
Any modifications you make will be rolled back on exit
|
||||||
irb(main):001:0>
|
irb(main):001:0>
|
||||||
```
|
```
|
||||||
|
|
|
@ -1729,6 +1729,9 @@ Accepts a string for the HTML tag used to wrap attachments. Defaults to `"action
|
||||||
|
|
||||||
`config.load_defaults` sets new defaults up to and including the version passed. Such that passing, say, `6.0` also gets the new defaults from every version before it.
|
`config.load_defaults` sets new defaults up to and including the version passed. Such that passing, say, `6.0` also gets the new defaults from every version before it.
|
||||||
|
|
||||||
|
#### For '7.1', defaults from previous versions below and:
|
||||||
|
|
||||||
|
|
||||||
#### For '7.0', defaults from previous versions below and:
|
#### For '7.0', defaults from previous versions below and:
|
||||||
|
|
||||||
- `config.action_controller.raise_on_open_redirects`: `true`
|
- `config.action_controller.raise_on_open_redirects`: `true`
|
||||||
|
|
|
@ -339,7 +339,7 @@ Processing by PostsController#index as HTML
|
||||||
10| # GET /posts/1 or /posts/1.json
|
10| # GET /posts/1 or /posts/1.json
|
||||||
11| def show
|
11| def show
|
||||||
=>#0 PostsController#index at ~/projects/rails-guide-example/app/controllers/posts_controller.rb:7
|
=>#0 PostsController#index at ~/projects/rails-guide-example/app/controllers/posts_controller.rb:7
|
||||||
#1 ActionController::BasicImplicitRender#send_action(method="index", args=[]) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.0.0.alpha2/lib/action_controller/metal/basic_implicit_render.rb:6
|
#1 ActionController::BasicImplicitRender#send_action(method="index", args=[]) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.1.0.alpha/lib/action_controller/metal/basic_implicit_render.rb:6
|
||||||
# and 72 frames (use `bt' command for all frames)
|
# and 72 frames (use `bt' command for all frames)
|
||||||
(rdbg)
|
(rdbg)
|
||||||
```
|
```
|
||||||
|
@ -403,14 +403,14 @@ When used without any options, it lists all the frames on the stack:
|
||||||
|
|
||||||
```rb
|
```rb
|
||||||
=>#0 PostsController#index at ~/projects/rails-guide-example/app/controllers/posts_controller.rb:7
|
=>#0 PostsController#index at ~/projects/rails-guide-example/app/controllers/posts_controller.rb:7
|
||||||
#1 ActionController::BasicImplicitRender#send_action(method="index", args=[]) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.0.0.alpha2/lib/action_controller/metal/basic_implicit_render.rb:6
|
#1 ActionController::BasicImplicitRender#send_action(method="index", args=[]) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.1.0.alpha/lib/action_controller/metal/basic_implicit_render.rb:6
|
||||||
#2 AbstractController::Base#process_action(method_name="index", args=[]) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.0.0.alpha2/lib/abstract_controller/base.rb:214
|
#2 AbstractController::Base#process_action(method_name="index", args=[]) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.1.0.alpha/lib/abstract_controller/base.rb:214
|
||||||
#3 ActionController::Rendering#process_action(#arg_rest=nil) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.0.0.alpha2/lib/action_controller/metal/rendering.rb:53
|
#3 ActionController::Rendering#process_action(#arg_rest=nil) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.1.0.alpha/lib/action_controller/metal/rendering.rb:53
|
||||||
#4 block in process_action at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.0.0.alpha2/lib/abstract_controller/callbacks.rb:221
|
#4 block in process_action at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actionpack-7.1.0.alpha/lib/abstract_controller/callbacks.rb:221
|
||||||
#5 block in run_callbacks at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0.alpha2/lib/active_support/callbacks.rb:118
|
#5 block in run_callbacks at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/activesupport-7.1.0.alpha/lib/active_support/callbacks.rb:118
|
||||||
#6 ActionText::Rendering::ClassMethods#with_renderer(renderer=#<PostsController:0x0000000000af78>) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actiontext-7.0.0.alpha2/lib/action_text/rendering.rb:20
|
#6 ActionText::Rendering::ClassMethods#with_renderer(renderer=#<PostsController:0x0000000000af78>) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actiontext-7.1.0.alpha/lib/action_text/rendering.rb:20
|
||||||
#7 block {|controller=#<PostsController:0x0000000000af78>, action=#<Proc:0x00007fd91985f1c0 /Users/st0012/...|} in <class:Engine> (4 levels) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actiontext-7.0.0.alpha2/lib/action_text/engine.rb:69
|
#7 block {|controller=#<PostsController:0x0000000000af78>, action=#<Proc:0x00007fd91985f1c0 /Users/st0012/...|} in <class:Engine> (4 levels) at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/actiontext-7.1.0.alpha/lib/action_text/engine.rb:69
|
||||||
#8 [C] BasicObject#instance_exec at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0.alpha2/lib/active_support/callbacks.rb:127
|
#8 [C] BasicObject#instance_exec at ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/activesupport-7.1.0.alpha/lib/active_support/callbacks.rb:127
|
||||||
..... and more
|
..... and more
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -318,6 +318,11 @@
|
||||||
description: >
|
description: >
|
||||||
This guide provides steps to be followed when you upgrade your
|
This guide provides steps to be followed when you upgrade your
|
||||||
applications to a newer version of Ruby on Rails.
|
applications to a newer version of Ruby on Rails.
|
||||||
|
-
|
||||||
|
name: Version 7.1 - ?
|
||||||
|
url: 7_1_release_notes.html
|
||||||
|
description: Release notes for Rails 7.1.
|
||||||
|
work_in_progress: true
|
||||||
-
|
-
|
||||||
name: Version 7.0 - ?
|
name: Version 7.0 - ?
|
||||||
url: 7_0_release_notes.html
|
url: 7_0_release_notes.html
|
||||||
|
|
|
@ -44,7 +44,7 @@ from.
|
||||||
In special situations, where someone from the Core Team agrees to support more series,
|
In special situations, where someone from the Core Team agrees to support more series,
|
||||||
they are included in the list of supported series.
|
they are included in the list of supported series.
|
||||||
|
|
||||||
**Currently included series:** `7.0.Z`.
|
**Currently included series:** `7.1.Z`.
|
||||||
|
|
||||||
Security Issues
|
Security Issues
|
||||||
---------------
|
---------------
|
||||||
|
@ -64,7 +64,7 @@ non-security related bugs resulting from a security patch may be published on a
|
||||||
release's x-y-stable branch, and will only be released as a new gem in
|
release's x-y-stable branch, and will only be released as a new gem in
|
||||||
accordance with the Bug Fixes policy.
|
accordance with the Bug Fixes policy.
|
||||||
|
|
||||||
**Currently included series:** `7.0.Z`, `6.1.Z`, `5.2.Z`.
|
**Currently included series:** `7.1.Z`, `7.0.Z`, `6.1.Z`.
|
||||||
|
|
||||||
Severe Security Issues
|
Severe Security Issues
|
||||||
----------------------
|
----------------------
|
||||||
|
@ -73,7 +73,7 @@ For severe security issues all releases in the current major series, and also th
|
||||||
last release in the previous major series will receive patches and new versions. The
|
last release in the previous major series will receive patches and new versions. The
|
||||||
classification of the security issue is judged by the core team.
|
classification of the security issue is judged by the core team.
|
||||||
|
|
||||||
**Currently included series:** `7.0.Z`, `6.1.Z`, `6.0.Z`, `5.2.Z`.
|
**Currently included series:** `7.1.Z`, `7.0.Z`, `6.1.Z`.
|
||||||
|
|
||||||
Unsupported Release Series
|
Unsupported Release Series
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
|
@ -75,6 +75,9 @@ The new Rails version might have different configuration defaults than the previ
|
||||||
|
|
||||||
To allow you to upgrade to new defaults one by one, the update task has created a file `config/initializers/new_framework_defaults_X.Y.rb` (with the desired Rails version in the filename). You should enable the new configuration defaults by uncommenting them in the file; this can be done gradually over several deployments. Once your application is ready to run with new defaults, you can remove this file and flip the `config.load_defaults` value.
|
To allow you to upgrade to new defaults one by one, the update task has created a file `config/initializers/new_framework_defaults_X.Y.rb` (with the desired Rails version in the filename). You should enable the new configuration defaults by uncommenting them in the file; this can be done gradually over several deployments. Once your application is ready to run with new defaults, you can remove this file and flip the `config.load_defaults` value.
|
||||||
|
|
||||||
|
Upgrading from Rails 7.0 to Rails 7.1
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
Upgrading from Rails 6.1 to Rails 7.0
|
Upgrading from Rails 6.1 to Rails 7.0
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -1,199 +1,3 @@
|
||||||
* Remove deprecated `config` in `dbconsole`.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
* Change default `X-XSS-Protection` header to disable XSS auditor
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/railties/CHANGELOG.md) for previous changes.
|
||||||
|
|
||||||
This header has been deprecated and the XSS auditor it triggered
|
|
||||||
has been removed from all major modern browsers (in favour of
|
|
||||||
Content Security Policy) that implemented this header to begin with
|
|
||||||
(Firefox never did).
|
|
||||||
|
|
||||||
[OWASP](https://owasp.org/www-project-secure-headers/#x-xss-protection)
|
|
||||||
suggests setting this header to '0' to disable the default behaviour
|
|
||||||
on old browsers as it can introduce additional security issues.
|
|
||||||
|
|
||||||
Added the new behaviour as a framework default from Rails 7.0.
|
|
||||||
|
|
||||||
*Christian Sutter*
|
|
||||||
|
|
||||||
* Scaffolds now use date_field, time_field and datetime_field instead of
|
|
||||||
date_select, time_select and datetime_select; thus providing native date/time pickers.
|
|
||||||
|
|
||||||
*Martijn Lafeber*
|
|
||||||
|
|
||||||
* Fix a regression in which autoload paths were initialized too late.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* Fix activestorage dependency in the npm package.
|
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
|
||||||
|
|
||||||
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
|
||||||
|
|
||||||
* New and upgraded Rails apps no longer generate `config/initializers/application_controller_renderer.rb`
|
|
||||||
or `config/initializers/cookies_serializer.rb`
|
|
||||||
|
|
||||||
The default value for `cookies_serializer` (`:json`) has been moved to `config.load_defaults("7.0")`.
|
|
||||||
The new framework defaults file can be used to upgrade the serializer.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* New applications get a dependency on the new `debug` gem, replacing `byebug`.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* Add SSL support for postgresql in `bin/rails dbconsole`.
|
|
||||||
|
|
||||||
Fixes #43114.
|
|
||||||
|
|
||||||
*Michael Bayucot*
|
|
||||||
|
|
||||||
* Add support for comments above gem declaration in Rails application templates, e.g. `gem("nokogiri", comment: "For XML")`.
|
|
||||||
|
|
||||||
*Linas Juškevičius*
|
|
||||||
|
|
||||||
* The setter `config.autoloader=` has been deleted. `zeitwerk` is the only
|
|
||||||
available autoloading mode.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* `config.autoload_once_paths` can be configured in the body of the
|
|
||||||
application class defined in `config/application.rb` or in the configuration
|
|
||||||
for environments in `config/environments/*`.
|
|
||||||
|
|
||||||
Similarly, engines can configure that collection in the class body of the
|
|
||||||
engine class or in the configuration for environments.
|
|
||||||
|
|
||||||
After that, the collection is frozen, and you can autoload from those paths.
|
|
||||||
They are managed by the `Rails.autoloaders.once` autoloader, which does not
|
|
||||||
reload, only autoloads/eager loads.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* During initialization, you cannot autoload reloadable classes or modules
|
|
||||||
like application models, unless they are wrapped in a `to_prepare` block.
|
|
||||||
For example, from `config/initializers/*`, or in application, engines, or
|
|
||||||
railties initializers.
|
|
||||||
|
|
||||||
Please check the [autoloading
|
|
||||||
guide](https://guides.rubyonrails.org/v7.0/autoloading_and_reloading_constants.html#autoloading-when-the-application-boots)
|
|
||||||
for details.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* While they are allowed to have elements in common, it is no longer required
|
|
||||||
that `config.autoload_once_paths` is a subset of `config.autoload_paths`.
|
|
||||||
The former are managed by the `once` autoloader. The `main` autoloader
|
|
||||||
manages the latter minus the former.
|
|
||||||
|
|
||||||
*Xavier Noria*
|
|
||||||
|
|
||||||
* Show Rake task description if command is run with `-h`.
|
|
||||||
|
|
||||||
Adding `-h` (or `--help`) to a Rails command that's a Rake task now outputs
|
|
||||||
the task description instead of the general Rake help.
|
|
||||||
|
|
||||||
*Petrik de Heus*
|
|
||||||
|
|
||||||
* Add missing `plugin new` command to help.
|
|
||||||
|
|
||||||
*Petrik de Heus
|
|
||||||
|
|
||||||
* Fix `config_for` error when there's only a shared root array.
|
|
||||||
|
|
||||||
*Loïc Delmaire*
|
|
||||||
|
|
||||||
* Raise an error in generators if an index type is invalid.
|
|
||||||
|
|
||||||
*Petrik de Heus*
|
|
||||||
|
|
||||||
* `package.json` now uses a strict version constraint for Rails JavaScript packages on new Rails apps.
|
|
||||||
|
|
||||||
*Zachary Scott*, *Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Modified scaffold generator template so that running
|
|
||||||
`rails g scaffold Author` no longer generates tests called "creating
|
|
||||||
a Author", "updating a Author", and "destroying a Author".
|
|
||||||
|
|
||||||
Fixes #40744.
|
|
||||||
|
|
||||||
*Michael Duchemin*
|
|
||||||
|
|
||||||
* Raise an error in generators if a field type is invalid.
|
|
||||||
|
|
||||||
*Petrik de Heus*
|
|
||||||
|
|
||||||
* `bin/rails tmp:clear` deletes also files and directories in `tmp/storage`.
|
|
||||||
|
|
||||||
*George Claghorn*
|
|
||||||
|
|
||||||
* Fix compatibility with `psych >= 4`.
|
|
||||||
|
|
||||||
Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
|
|
||||||
`Rails.application.config_for` now uses `YAML.unsafe_load` if available.
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* Allow loading nested locales in engines.
|
|
||||||
|
|
||||||
*Gannon McGibbon*
|
|
||||||
|
|
||||||
* Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
|
|
||||||
|
|
||||||
*Jean Boussier*
|
|
||||||
|
|
||||||
* Remove `Rack::Runtime` from the default middleware stack and deprecate
|
|
||||||
referencing it in middleware operations without adding it back.
|
|
||||||
|
|
||||||
*Hartley McGuire*
|
|
||||||
|
|
||||||
* Allow adding additional authorized hosts in development via `ENV['RAILS_DEVELOPMENT_HOSTS']`.
|
|
||||||
|
|
||||||
*Josh Abernathy*, *Debbie Milburn*
|
|
||||||
|
|
||||||
* Add app concern and test keepfiles to generated engine plugins.
|
|
||||||
|
|
||||||
*Gannon McGibbon*
|
|
||||||
|
|
||||||
* Stop generating a license for in-app plugins.
|
|
||||||
|
|
||||||
*Gannon McGibbon*
|
|
||||||
|
|
||||||
* `rails app:update` no longer prompts you to overwrite files that are generally modified in the
|
|
||||||
course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
|
|
||||||
the full list of changes.
|
|
||||||
|
|
||||||
*Alex Ghiculescu*
|
|
||||||
|
|
||||||
* Change default branch for new Rails projects and plugins to `main`.
|
|
||||||
|
|
||||||
*Prateek Choudhary*
|
|
||||||
|
|
||||||
* The new method `Rails.benchmark` gives you a quick way to measure and log the execution time taken by a block:
|
|
||||||
|
|
||||||
def test_expensive_stuff
|
|
||||||
Rails.benchmark("test_expensive_stuff") { ... }
|
|
||||||
end
|
|
||||||
|
|
||||||
This functionality was available in some contexts only before.
|
|
||||||
|
|
||||||
*Simon Perepelitsa*
|
|
||||||
|
|
||||||
* Applications generated with `--skip-sprockets` no longer get `app/assets/config/manifest.js` and `app/assets/stylesheets/application.css`.
|
|
||||||
|
|
||||||
*Cindy Gao*
|
|
||||||
|
|
||||||
* Add support for stylesheets and ERB views to `rails stats`.
|
|
||||||
|
|
||||||
*Joel Hawksley*
|
|
||||||
|
|
||||||
* Allow appended root routes to take precedence over internal welcome controller.
|
|
||||||
|
|
||||||
*Gannon McGibbon*
|
|
||||||
|
|
||||||
|
|
||||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/railties/CHANGELOG.md) for previous changes.
|
|
||||||
|
|
|
@ -249,6 +249,8 @@ module Rails
|
||||||
|
|
||||||
action_controller.wrap_parameters_by_default = true
|
action_controller.wrap_parameters_by_default = true
|
||||||
end
|
end
|
||||||
|
when "7.1"
|
||||||
|
load_defaults "7.0"
|
||||||
else
|
else
|
||||||
raise "Unknown version #{target_version.to_s.inspect}"
|
raise "Unknown version #{target_version.to_s.inspect}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,9 +8,9 @@ module Rails
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,117 +0,0 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
|
||||||
#
|
|
||||||
# This file eases your Rails 7.0 framework defaults upgrade.
|
|
||||||
#
|
|
||||||
# Uncomment each configuration one by one to switch to the new default.
|
|
||||||
# Once your application is ready to run with all new defaults, you can remove
|
|
||||||
# this file and set the `config.load_defaults` to `7.0`.
|
|
||||||
#
|
|
||||||
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
|
||||||
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
|
||||||
|
|
||||||
# `button_to` view helper will render `<button>` element, regardless of whether
|
|
||||||
# or not the content is passed as the first argument or as a block.
|
|
||||||
# Rails.application.config.action_view.button_to_generates_button_tag = true
|
|
||||||
|
|
||||||
# `stylesheet_link_tag` view helper will not render the media attribute by default.
|
|
||||||
# Rails.application.config.action_view.apply_stylesheet_media_default = false
|
|
||||||
|
|
||||||
# Change the digest class for the key generators to `OpenSSL::Digest::SHA256`.
|
|
||||||
# Changing this default means invalidate all encrypted messages generated by
|
|
||||||
# your application and, all the encrypted cookies. Only change this after you
|
|
||||||
# rotated all the messages using the key rotator.
|
|
||||||
#
|
|
||||||
# See upgrading guide for more information on how to build a rotator.
|
|
||||||
# https://guides.rubyonrails.org/v7.0/upgrading_ruby_on_rails.html
|
|
||||||
# Rails.application.config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA256
|
|
||||||
|
|
||||||
# Change the digest class for ActiveSupport::Digest.
|
|
||||||
# Changing this default means that for example Etags change and
|
|
||||||
# various cache keys leading to cache invalidation.
|
|
||||||
# Rails.application.config.active_support.hash_digest_class = OpenSSL::Digest::SHA256
|
|
||||||
|
|
||||||
# Don't override ActiveSupport::TimeWithZone.name and use the default Ruby
|
|
||||||
# implementation.
|
|
||||||
# Rails.application.config.active_support.remove_deprecated_time_with_zone_name = true
|
|
||||||
|
|
||||||
# Change the format of the cache entry.
|
|
||||||
# Changing this default means that all new cache entries added to the cache
|
|
||||||
# will have a different format that is not supported by Rails 6.1 applications.
|
|
||||||
# Only change this value after your application is fully deployed to Rails 7.0
|
|
||||||
# and you have no plans to rollback.
|
|
||||||
# Rails.application.config.active_support.cache_format_version = 7.0
|
|
||||||
|
|
||||||
# Calls `Rails.application.executor.wrap` around test cases.
|
|
||||||
# This makes test cases behave closer to an actual request or job.
|
|
||||||
# Several features that are normally disabled in test, such as Active Record query cache
|
|
||||||
# and asynchronous queries will then be enabled.
|
|
||||||
# Rails.application.config.active_support.executor_around_test_case = true
|
|
||||||
|
|
||||||
# Define the isolation level of most of Rails internal state.
|
|
||||||
# If you use a fiber based server or job processor, you should set it to `:fiber`.
|
|
||||||
# Otherwise the default of `:thread` if preferable.
|
|
||||||
# Rails.application.config.active_support.isolation_level = :thread
|
|
||||||
|
|
||||||
# Set both the `:open_timeout` and `:read_timeout` values for `:smtp` delivery method.
|
|
||||||
# Rails.application.config.action_mailer.smtp_timeout = 5
|
|
||||||
|
|
||||||
# The ActiveStorage video previewer will now use scene change detection to generate
|
|
||||||
# better preview images (rather than the previous default of using the first frame
|
|
||||||
# of the video).
|
|
||||||
# Rails.application.config.active_storage.video_preview_arguments =
|
|
||||||
# "-vf 'select=eq(n\\,0)+eq(key\\,1)+gt(scene\\,0.015),loop=loop=-1:size=2,trim=start_frame=1' -frames:v 1 -f image2"
|
|
||||||
|
|
||||||
# Automatically infer `inverse_of` for associations with a scope.
|
|
||||||
# Rails.application.config.active_record.automatic_scope_inversing = true
|
|
||||||
|
|
||||||
# Raise when running tests if fixtures contained foreign key violations
|
|
||||||
# Rails.application.config.active_record.verify_foreign_keys_for_fixtures = true
|
|
||||||
|
|
||||||
# Disable partial inserts.
|
|
||||||
# This default means that all columns will be referenced in INSERT queries
|
|
||||||
# regardless of whether they have a default or not.
|
|
||||||
# Rails.application.config.active_record.partial_inserts = false
|
|
||||||
#
|
|
||||||
# Protect from open redirect attacks in `redirect_back_or_to` and `redirect_to`.
|
|
||||||
# Rails.application.config.action_controller.raise_on_open_redirects = true
|
|
||||||
|
|
||||||
# Change the variant processor for Active Storage.
|
|
||||||
# Changing this default means updating all places in your code that
|
|
||||||
# generate variants to use image processing macros and ruby-vips
|
|
||||||
# operations. See the upgrading guide for detail on the changes required.
|
|
||||||
# The `:mini_magick` option is not deprecated; it's fine to keep using it.
|
|
||||||
# Rails.application.config.active_storage.variant_processor = :vips
|
|
||||||
|
|
||||||
# If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer
|
|
||||||
# was `:marshal`. Convert all cookies to JSON, using the `:hybrid` formatter.
|
|
||||||
#
|
|
||||||
# If you're confident all your cookies are JSON formatted, you can switch to the `:json` formatter.
|
|
||||||
#
|
|
||||||
# Continue to use `:marshal` for backward-compatibility with old cookies.
|
|
||||||
#
|
|
||||||
# If you have configured the serializer elsewhere, you can remove this.
|
|
||||||
#
|
|
||||||
# See https://guides.rubyonrails.org/action_controller_overview.html#cookies for more information.
|
|
||||||
# Rails.application.config.action_dispatch.cookies_serializer = :hybrid
|
|
||||||
|
|
||||||
# Enable parameter wrapping for JSON.
|
|
||||||
# Previously this was set in an initializer. It's fine to keep using that initializer if you've customized it.
|
|
||||||
# To disable parameter wrapping entirely, set this config to `false`.
|
|
||||||
# Rails.application.config.action_controller.wrap_parameters_by_default = true
|
|
||||||
|
|
||||||
# Specifies whether generated namespaced UUIDs follow the RFC 4122 standard for namespace IDs provided as a
|
|
||||||
# `String` to `Digest::UUID.uuid_v3` or `Digest::UUID.uuid_v5` method calls.
|
|
||||||
#
|
|
||||||
# See https://guides.rubyonrails.org/configuring.html#config-active-support-use-rfc4122-namespaced-uuids for
|
|
||||||
# more information.
|
|
||||||
# Rails.application.config.active_support.use_rfc4122_namespaced_uuids = true
|
|
||||||
|
|
||||||
# Change the default headers to disable browsers' flawed legacy XSS protection.
|
|
||||||
# Rails.application.config.action_dispatch.default_headers = {
|
|
||||||
# "X-Frame-Options" => "SAMEORIGIN",
|
|
||||||
# "X-XSS-Protection" => "0",
|
|
||||||
# "X-Content-Type-Options" => "nosniff",
|
|
||||||
# "X-Download-Options" => "noopen",
|
|
||||||
# "X-Permitted-Cross-Domain-Policies" => "none",
|
|
||||||
# "Referrer-Policy" => "strict-origin-when-cross-origin"
|
|
||||||
# }
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
#
|
||||||
|
# This file eases your Rails 7.1 framework defaults upgrade.
|
||||||
|
#
|
||||||
|
# Uncomment each configuration one by one to switch to the new default.
|
||||||
|
# Once your application is ready to run with all new defaults, you can remove
|
||||||
|
# this file and set the `config.load_defaults` to `7.1`.
|
||||||
|
#
|
||||||
|
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||||
|
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
|
@ -8,9 +8,9 @@ module Rails
|
||||||
|
|
||||||
module VERSION
|
module VERSION
|
||||||
MAJOR = 7
|
MAJOR = 7
|
||||||
MINOR = 0
|
MINOR = 1
|
||||||
TINY = 0
|
TINY = 0
|
||||||
PRE = "alpha2"
|
PRE = "alpha"
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue