2024/02/21分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Remove deprecated
Rails.application.config.active_record.suppress_multiple_database_warning
. - Remove deprecated support to call
alias_attribute
with non-existent attribute names. - Remove deprecated
name
argument fromActiveRecord::Base.remove_connection
. - Remove deprecated
ActiveRecord::Base.clear_active_connections!
. - Remove deprecated
ActiveRecord::Base.clear_reloadable_connections!
. - Remove deprecated
ActiveRecord::Base.clear_all_connection!
. - Remove deprecated
ActiveRecord::Base.flush_idle_connections!
. - Remove deprecated
ActiveRecord::ActiveJobRequiredError
. - Remove deprecated support to define
explain
in the connection adapter with 2 arguments. - Remove deprecated
ActiveRecord::LogSubscriber.runtime
method. - Remove deprecated
ActiveRecord::LogSubscriber.runtime=
method. - Remove deprecated
ActiveRecord::LogSubscriber.reset_runtime
method. - Remove deprecated
ActiveRecord::Migration.check_pending
method. - Remove deprecated support to passing
SchemaMigration
andInternalMetadata
classes as arguments toActiveRecord::MigrationContext
. - Remove deprecated behavior to support referring to a singular association by its plural name.
- Deprecate
Rails.application.config.active_record.allow_deprecated_singular_associations_name
- Remove deprecated
TestFixtures.fixture_path
. - Remove deprecated support to
ActiveRecord::Base#read_attribute(:id)
to return the custom primary key value - Remove deprecated support to passing coder and class as second argument to
serialize
. - Remove deprecated
#all_foreign_keys_valid?
from database adapters. - Remove deprecated
ActiveRecord::ConnectionAdapters::SchemaCache.load_from
. - Remove deprecated
ActiveRecord::ConnectionAdapters::SchemaCache#data_sources
. - Remove deprecated
#all_connection_pools
. - Remove deprecated support to apply
#connection_pool_list
,#active_connections?
,#clear_active_connections!
#clear_reloadable_connections!
,#clear_all_connections!
and#flush_idle_connections!
to the connections pools for the current role when therole
argument isn't provided. - Remove deprecated
ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass
- Remove deprecated
#quote_bound_value
- Remove deprecated support to quote
ActiveSupport::Duration
- Remove deprecated support to pass
deferrable: true
toadd_foreign_key
- Remove deprecated support to pass
rewhere
toActiveRecord::Relation#merge
- Remove deprecated behavior that would rollback a transaction block when exited using
return
,break
orthrow
. - Deprecate
Rails.application.config.active_record.commit_transaction_on_non_local_return
.
Merge pull request #51130 from Yegorov/fix-typo-in-devcontainer
railties/lib/rails/generators/devcontainer.rb
の修正です。
devcontainerで作成するnetwork名をタイポしていたのを修正しています。
actionmailbox/app/controllers/action_mailbox/ingresses/relay/inbound_emails_controller.rb
のdocの修正です。
ActionMailbox::Ingresses::Relay::InboundEmailsController
のdocのフォーマットを修正しています。
Merge pull request #51141 from peterberkenbosch/update-test-case-generator-to-codestyle
railties/lib/rails/generators/rails/app/templates/test/application_system_test_case.rb.tt
の修正です。
generatorで生成されるapplication_system_test_case.rb
にRubocopでエラーになる箇所があったのを修正しています。
Merge pull request #51118 from fatkodima/missing-connection_pool-in-errors-assignments
Active Recordの修正です。
Store connection_pool in database-related exceptionsでDB関連のexceptionでconnection_poolの値を保持するよう修正したのですが、connection_poolを指定し忘れているexceptionがあったので、そちらにもexceptionを渡すよう修正しています。
Improve title tag for new apps (#51134)
railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt
の修正です。
titleのタグのデフォルト値にアプリ名を使用するよう修正しています。
Remove deprecated Rails.application.config.active_record.suppress_multiple_database_warning
activerecord/lib/active_record.rb
の修正です。
deprecatdになっていたRails.application.config.active_record.suppress_multiple_database_warning
を削除しています。
[R] Remove deprecated support to call alias_attribute
with non-existent attribute names
activerecord/lib/active_record/attribute_methods.rb
の修正です。
deprecatedになっていた、存在しないattribute namesに対するalias_attribute
のサポートを削除しています。
Remove deprecated name
argument from ActiveRecord::Base.remove_connection
activerecord/lib/active_record/connection_handling.rb
の修正です。
deprecatedになっていたActiveRecord::Base.remove_connection
のname
引数を削除しています。
Remove deprecated methods in ActiveRecord::Base
activerecord/lib/active_record/connection_handling.rb
の修正です。
deprecatedになっていた、ActiveRecord::Base.clear_active_connections!
、ActiveRecord::Base.clear_reloadable_connections!
、ActiveRecord::Base.clear_all_connections!
及びActiveRecord::Base.flush_idle_connections!
メソッドを削除しています。
Remove deprecated ActiveRecord::ActiveJobRequiredError
activerecord/lib/active_record/errors.rb
の修正です。
deprecatedになっていたActiveRecord::ActiveJobRequiredError
を削除しています。
Remove deprecated support to define explain
in the connection adapter with 2 arguments
activerecord/lib/active_record/explain.rb
の修正です。
ddeprecatedになっていた、connection adapterに引数を2つ受け取れるexplain
メソッドを定義した場合のサポートを削除しています。
Remove deprecated methods on ActiveRecord::LogSubscriber
activerecord/lib/active_record/log_subscriber.rb
の修正です。
deprecatedになっていた、ActiveRecord::LogSubscriber.runtime
、ActiveRecord::LogSubscriber.runtime=
及びActiveRecord::LogSubscriber.reset_runtime
メソッドを削除しています。
Remove deprecated ActiveRecord::Migration.check_pending
method
activerecord/lib/active_record/migration.rb
の修正です。
deprecatedになっていたActiveRecord::Migration.check_pending
メソッドを削除しています。
activerecord/lib/active_record/migration.rb
の修正です。
deprecatedになっていたActiveRecord::MigrationContext
にSchemaMigration
及びInternalMetadata
を渡した場合の挙動を削除しています。
Remove deprecated behavior to support referring to a singular association by its plural name
activerecord/lib/active_record.rb
、
activerecord/lib/active_record/table_metadata.rb
の修正です。
deprecatedになっていた、singular associationをplural nameで指定した場合の挙動を削除しています。合わせて、この挙動を制御するためのconfig(Rails.application.config.active_record.allow_deprecated_singular_associations_name
)をdeprecatedにしています。
Remove deprecated TestFixtures.fixture_path
activerecord/lib/active_record/test_fixtures.rb
の修正です。
deprecatedになっていたTestFixtures.fixture_path
を削除しています。
activerecord/lib/active_record/attribute_methods/read.rb
の修正です。
deprecatedになっていたActiveRecord::Base#read_attribute(:id)
がcustom primary keyの値を返す挙動を削除しています。
Remove deprecated support to passing coder and class as second argument to serialize
activerecord/lib/active_record/attribute_methods/serialization.rb
の修正です。
deprecatedになっていたserialize
メソッドの第二引数にcoderとclassを指定した場合のサポートを削除しています。
Remove deprecated #all_foreign_keys_valid?
from database adapters
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
の修正です。
deprecatedになっていたdatabase adapterの#all_foreign_keys_valid?
メソッドを削除しています。
Remove deprecated ActiveRecord::ConnectionAdapters::SchemaCache.load_from
activerecord/lib/active_record/connection_adapters/schema_cache.rb
の修正です。
deprecatedになっていたActiveRecord::ConnectionAdapters::SchemaCache.load_from
メソッドを削除しています。
Remove deprecated ActiveRecord::ConnectionAdapters::SchemaCache#data_sources
activerecord/lib/active_record/connection_adapters/schema_cache.rb
の修正です。
deprecatedになっていたActiveRecord::ConnectionAdapters::SchemaCache#data_sources
を削除しています。
Remove deprecated #all_connection_pools
activerecord/lib/active_record/connection_adapters/schema_cache.rb
の修正です。
deprecatedになっていた#all_connection_pools
を削除しています。
activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb
の修正です。
role
引数が指定されなかった場合に、#connection_pool_list
, #active_connections?
, #clear_active_connections!
,#clear_reloadable_connections!
, #clear_all_connections!
及び #flush_idle_connections!
メソッドでcurrent roleのconnection poolをデフォルトで使用する挙動を削除しています。
Remove deprecated ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
の修正です。
deprecatedになっていたActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass
を削除しています。
Remove deprecated #quote_bound_value
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
の修正です。
deprecatedになっていた#quote_bound_value
を削除しています。
Remove deprecated support to quote ActiveSupport::Duration
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
の修正です。
deprecatedになっていた、SQL string template でActiveSupport::Duration
のインスタンスをinterpolated bind parameterとして渡した場合の挙動を削除しています。
Remove deprecated support to pass deferrable: true
to add_foreign_key
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
、
activerecord/lib/active_record/connection_adapters/sqlite3/schema_statements.rb
の修正です。
deprecatedになっていたadd_foreign_key
にdeferrable: true
を指定した場合の挙動を削除しています。
Remove deprecated support to pass rewhere
to ActiveRecord::Relation#merge
Active Recordの修正です。
deprecatedになっていたActiveRecord::Relation#merge
のrewhere
引数を指定した場合の挙動を削除しています。
activerecord/lib/active_record.rb
、
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
deprecatedになっていた、transaction block内でreturn
, break
又は throw
を実行した場合にrollackをする、という挙動を削除しています。合わせて、この挙動を制御するためのconfig(Rails.application.config.active_record.commit_transaction_on_non_local_return
)を削除しています。
Merge pull request #51112 from dorianmariecom/dorian/to_s-for-generated-attribute
railties/lib/rails/generators/generated_attribute.rb
の修正です。
generated attributeをstringに変換するためのRails::Generators::GeneratedAttribute#to_s
メソッドを追加しています。独自のgeneratorからmodel generatorの引数を呼び出す際に、フォーマットしたattributeを簡易に取得できるようにする為。
Merge pull request #51125 from c960657/log-outputs-to-filename
activesupport/lib/active_support/logger.rb
の修正です。
Logger.logger_outputs_to?
にファイル名を指定できるよう修正しています。
Logger.logger_outputs_to?('/var/log/rails.log')
Merge pull request #51047 from johnpitchko/add-query-docs-to-delegated-type
activerecord/lib/active_record/delegated_type.rb
のdocの修正です。
delegated typeのdocにrecordを跨いでのqueryを実行する場合の説明を追加しています。
Merge pull request #51131 from tonytonyjan/filter-redirect-params
actionpack/lib/action_dispatch/http/filter_redirect.rb
の修正です。
locationのredirectを行う際に、URLにconfig.filter_parameters
に指定したパラメータ名が含まれている場合、自動でそのパラメータをfilterするよう修正しています。
http://secret.foo.bar?username=roque&password=[FILTERED]
Merge pull request #51132 from tonytonyjan/docs/fix-fetch-example
activesupport/lib/active_support/cache.rb
のdocの修正です。
ActiveSupport::Cache::Store#fetch
のdoc内のrace conditionが発生する場合の挙動についての説明について、不要なスレッドの削除、コメントの削除等を行っています。
Increase assert_output timeout for FullStackConsoleTest
and ApplicationTests::ServerTest
railties/test/application/console_test.rb
、
railties/test/application/server_test.rb
の修正です。
console、及び、serverのテストで結果が取得できるまでのtimeoutの時間を伸ばしています。
Don't force controller or integration tests to load
railties/lib/rails/test_help.rb
の修正です。
action_controller/test_case
及びaction_dispatch/testing/integration
をrequireしないよう修正しています。modelのテストなどを実行する際に、不要なcontroller test及びintegration testのrequireを避ける為。
clear_query_caches_for_current_thread: avoid pinning all connections
activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
、
activerecord/lib/active_record/connection_handling.rb
の修正です。
poolのquery cacheをclearする際に、connectionのchekckout処理を行わないよう修正しています。Refactor QueryCache to be owned by the poolの対応でquery cacheはpoolで保持されるようになっており、clearするのにconnectionを経由する必要が無くなっている為。
Don't forcefully clear temporarily disabled query caches
activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
、
activerecord/lib/active_record/query_cache.rb
の修正です。
query cacheが一時的にdisabledになった場合に強制的に保持していたcacheをclearしていたのを、clearしないよう修正しています。read only queryなどを実行している場合clearする必要が無いはず、かつ、query cacheを再度有効化した場合にもclear処理を行っている為。
Fix code formatting in layouts and rendering guide
rails guideのLayouts and Rendering in Rails
の修正です。
The :variants Option
セクションにあるexampleコードのフォーマットを修正しています。
Relation#where build BoundSqlLiteral rather than eagerly interpolate
Active Recordの修正です。
Relation#where
でquery/relationを構築する際に、SQL fragmentのquoteやinterpolation valueの設定を行っていたのを、それらは行わず代わりにBoundSqlLiteral
を構築するよう修正しています。左記の処理はconnection settingに依存する為処理を行うのにconnectionが必要なのですが、PoC: Add an option to disable connection checkout cachingの為にconnectionを使う処理を減らす対応を行っており、その一環との事です。
Remove unused intermediate variable
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
使用していない変数を削除しています。