2021/11/18分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actionmailbox/CHANGELOG.md
actionmailer/CHANGELOG.md
actionpack/CHANGELOG.md
activejob/CHANGELOG.md
activemodel/CHANGELOG.md
activerecord/CHANGELOG.md
Fix spelling of Additionally
rails guideのSecuring Rails Applications
の修正です。
Additionally
をAditionally
にタイポしていたのを修正しています。
Merge pull request #43636 from TooManyBees/fix-preloader-association-nil-error
activerecord/lib/active_record/associations/preloader/association.rb
の修正です。
preloaderのrecordsにnilを指定した場合にNoMethodError
が発生してしまうリグレッションがあったのを修正しています。
が、この対応によりCIが壊れてしまったので、後ほどRevertされています。
Revert "Merge pull request #43636 from TooManyBees/fix-preloader-association-nil-error"
直前の、preloaderのrecordsにnilを指定した場合にNoMethodError
が発生してしまうリグレッションがあったのを修正した対応をRevertしています。CIが壊れてしまった為。
Remove deprecated MAILGUN_INGRESS_API_KEY and mailgun_api_key configurations
actionmailbox/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb
の修正です。
deprecatedになっていたMAILGUN_INGRESS_API_KEY
envのサポート、及び、Rails.application.credentials.action_mailbox.mailgun_api_key
を削除しています。
Remove deprecated ActionMailer::DeliveryJob and ActionMailer::Parameterized::DeliveryJob
Action Mailerの修正です。
deprecatedになっていたActionMailer::DeliveryJob
とActionMailer::Parameterized::DeliveryJob
を削除しています。
Remove deprecated ActionDispatch::Response.return_only_media_type_on_content_type
.
actionpack/lib/action_dispatch/http/response.rb
の修正です。
deprecatedになっていたActionDispatch::Response.return_only_media_type_on_content_type
を削除しています。
Remove deprecated Rails.config.action_dispatch.hosts_response_app
actionpack/lib/action_dispatch/middleware/host_authorization.rb
、
railties/lib/rails/application/default_middleware_stack.rb
の修正です。
deprecatedになっていたRails.config.action_dispatch.hosts_response_app
を削除しています。
Remove deprecated ActionDispatch::SystemTestCase#host!
actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
の修正です。
deprecatedになっていたActionDispatch::SystemTestCase#host!
を削除しています。
Remove deprecated support to passing a path to fixture_file_upload
relative to fixture_path
actionpack/lib/action_dispatch/testing/test_process.rb
の修正です。
deprecatedになっていたfixture_file_upload
にfixture_path
からの相対パスを指定した場合のサポートを削除しています。
Remove deprecated Rails.config.action_view.raise_on_missing_translations
Action Viewの修正です。
deprecatedになっていたRails.config.action_view.raise_on_missing_translations
を削除しています。
Removed deprecated behavior that was not halting after_enqueue
/after_perform
callbacks when a previous callback was halted with throw :abort
.
activejob/lib/active_job/callbacks.rb
の修正です。
deprecatedになっていた、after_enqueue
/ after_perform
callbacksで前のcallbackがthrow :abort
で終了した場合も処理を継続する、という挙動を削除しています。合わせて、この挙動を制御する為のconfig(Rails.config.active_job.skip_after_callbacks_if_terminated
)をdeprecatedにしています。
Remove deprecated enumeration of ActiveModel::Errors
instances as a Hash
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors
のenumeration処理でインスタンスをHash
として扱う挙動を削除しています。
Remove deprecated ActiveModel::Errors#to_h
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#to_h
を削除しています。
Remove deprecated ActiveModel::Errors#slice!
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#slice!
を削除しています。
Remove deprecated ActiveModel::Errors#values
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#values
を削除しています。
Remove deprecated ActiveModel::Errors#keys
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#keys
を削除しています。
Remove deprecated ActiveModel::Errors#to_xml
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#to_xml
を削除しています。
Remove unused method
activemodel/lib/active_model/errors.rb
の修正です。
上記deprecatedメソッドの削除により不要になったメソッドを削除しています。
Remove deprecated support concat errors to ActiveModel::Errors#messages
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#messages
に対するエラーメッセージのconcat処理を削除しています。
Remove deprecated support clear
errors from ActiveModel::Errors#messages
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#messages
に対するerrorsのclear処理を削除しています。
Remove unnecessary class
activemodel/lib/active_model/errors.rb
の修正です。
不要になったdeprecated処理の為のクラスを削除しています。
Implement each using a delegator and make sure all enumerable methods are available
activemodel/lib/active_model/errors.rb
の修正です。
ActiveModel::Errors#each
メソッドを独自に定義してたのを、他のenumerableメソッドと同様にdelegatorを使用するよう修正しています。deprecatedになっていた既存の挙動を削除することにより、独自のメソッドを定義する必要が無くなった為。
Remove deprecated support delete
errors from ActiveModel::Errors#messages
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#messages
に対するerrorsのdelete処理を削除しています。
Remove deprecated support to use []=
in ActiveModel::Errors#messages
activemodel/lib/active_model/errors.rb
の修正です。
deprecatedになっていたActiveModel::Errors#messages
に対する[]=
メソッドを削除しています。
Remove support to Marshal and YAML load Rails 5.x error format
activemodel/lib/active_model/errors.rb
の修正です。
Rails 5系のコードで作成されたActiveModel::Errors
のインスタンスのMarshal、 YAMLデータのロード処理のサポートを削除しています。
Remove support to Marshal load Rails 5.x ActiveModel::AttributeSet
format
activemodel/lib/active_model/attribute_set/builder.rb
の修正です。
Rails 5系のコードで作成されたActiveModel::AttributeSet
のインスタンスのMarshalデータのロード処理のサポートを削除しています。
Remove deprecated ActiveRecord::Base.allow_unsafe_raw_sql
activerecord/lib/active_record/core.rb
の修正です。
deprecatedになっていたActiveRecord::Base.allow_unsafe_raw_sql
を削除しています。
Remove deprecated option :spec_name
in the configs_for
method
activerecord/lib/active_record/database_configurations.rb
の修正です。
deprecatedになっていたconfigs_for
メソッドの:spec_name
引数を削除しています。
Remove deprecated support to YAML load ActiveRecord::Base
instance in the Rails 4.2 and 4.1 formats
activerecord/lib/active_record/core.rb
、
activerecord/lib/active_record/legacy_yaml_adapter.rb
の修正です。
Rails 4.1、及び、4.2のコードで作成されたActiveRecord::Base
のインスタンスのYAMLデータのロード処理のサポートを削除しています。
Remove deprecation warning when using :interval
column is used in PostgreSQL database
activerecord/lib/active_record/model_schema.rb
の修正です。
deprecatedになっていたPostgreSQLのinterval
datatypeをStringとして扱う処理を削除しています。今後は、ActiveSupport::Duration
として扱われるようになります。
Remove deprecated private API in ActiveRecord::Associations::Preloader
activerecord/lib/active_record/associations/preloader.rb
の修正です。
deprecacatedになっていたActiveRecord::Associations::Preloader
のAPIを削除しています。private APIなのでCHANGELOGはなし。
Remove deprecacated support to resolve connection using "primary"
as connection specification name
activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb
の修正です。
deprecatedになっていたconnection specification nameにprimary
という値を指定した場合の挙動を削除しています。
Remove deprecated support to quote ActiveRecord::Base
objects
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
の修正です。
deprecatedになっていた#quote
メソッドにActiveRecord::Base
のインスタンスを渡した場合の挙動を削除しています。
Remove deprecated support to type cast to database values ActiveRecord::Base
objects
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
の修正です。
deprecatedになっていた#type_cast
メソッドにActiveRecord::Base
のインスタンスを渡した場合の挙動を削除しています。
Remove deprecated support to pass a column to type_cast
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
の修正です。
deprecatedになっていた#type_cast
メソッドにcolumnを渡した場合の挙動を削除しています。
Inline _quote method
Active Recordの修正です。
quote
メソッドが_quote
メソッドを呼び出すだけになっていたのを、quote
で_quote
で行っていた処理を行うようにして、_quote
を削除するよう修正しています。
Inline _type_cast
Active Recordの修正です。
type_cast
メソッドが_type_cast
メソッドを呼び出すだけになっていたのを、type_cast
で_type_cast
で行っていた処理を行うようにして、_type_cast
を削除するよう修正しています。
Improve language in upgrading guide
rails guideのUpgrading Ruby on Rails
の修正です。
One file, one constant (at the same top-level)
の項の言い回しを修正しています。
Add automatic shard swapping middleware
Active Recordの修正です。
DBのshardのスワッピングを自動で行う為のRack middlewareを追加しています。
複数DB用のmiddlewareと同様に、requestの内容を元にどのsharedを使用するか、というresolverを指定出来るようになっています。
config.active_record.shard_resolver = ->(request) {
subdomain = request.subdomain
tenant = Tenant.find_by_subdomain!(subdomain)
tenant.shard
}
また、request毎のスワッピングを禁止したい場合は、config.active_record.shard_selector
に{ lock: true }
を指定すればよいようになっています。
Introduce ActiveSupport::IsolatedExecutionState for internal use
Active Supportの修正です。
requestやjobのlocal dataの保持にThreadを使うようになっていたのを、Fiberを使用出来るよう修正しています(ThreadだとEnumeratorのように異なるFiberで実行される処理で問題になっていた為)。
Threa / Fiberどちらを使用するかはconfig(config.active_support.isolation_level
)で指定出来るようになっており、デフォルトはThreadになっています。Fiberにしたい場合は、左記configに:fiber
を指定すればOKです。