なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2022/09/15)

2022/09/15分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activesupport/CHANGELOG.md


Remove redundant ELSE branch from the ActiveRecord::Base.in_order_of SQL query

activerecord/lib/active_record/relation/query_methods.rbの修正です。

ActiveRecord::Base.in_order_ofが生成するSQLから不要なELSE branchを削除しています。


Fix flaky PostgreSQL enum migration reversibility test

activerecord/test/cases/adapters/postgresql/invertible_migration_test.rbの修正です。

テストで生成したenumの削除処理が行われていなかったのを修正しています。


Merge pull request #46026 from jonathanhefner/deprecation-non-global-disallowed_warnings

activesupport/lib/active_support/deprecation/disallowed.rbの修正です。

ActiveSupport::Deprecation#disallowed_warningsで設定した内容が、全てのActiveSupport::Deprecationインスタンスに影響が出るようになっていたのを、設定したインスタンスでのみ影響を受けるよう修正しています。合わせて、globalのActiveSupport::Deprecation.disallowed_warningsで設定した内容は、globalのActiveSupport::Deprecation.warnにのみ影響が出るようにし、個別のインスタンスの設定には影響が出ないよう修正しています。


Test more AS::Deprecation behavior callbacks

activesupport/test/deprecation_test.rbの修正です。

ActiveSupport::Deprecationbehaviorにcallbackを指定した場合のテストを追加しています。


Derive arity of AS::Deprecation behavior callbacks

activesupport/lib/active_support/deprecation/behaviors.rbの修正です。

ActiveSupport::Deprecationのcallbackにarityが定義されていないobject(e.g. callable object)も指定出来るよう修正しています。


Prefer capture_io in AS::Deprecation tests

activesupport/test/deprecation_test.rbの修正です。

stderrをcaptureするのにRails独自のhelperメソッドを使用していたのを、minitestが提供しているメソッド(capture_io)を使用するよう修正しています。

が、他の処理と処理は合わせた方が可読性が良いだろう、という事で後ほどRails独自のhelperメソッドを使うよう戻しています。


Merge pull request #45877 from neilvilela/nc-composed-of-hash

activerecord/lib/active_record/aggregations.rbのdoc、及び、activerecord/test/cases/aggregations_test.rbの修正です。

`composed_ofmappingを指定した場合のテスト、及び、docにexampleを追加しています。


Switch back to capture in AS::Deprecation tests

activesupport/test/deprecation_test.rbの修正です。

Prefer capture_io in AS::Deprecation testsで行った変更を元に戻しています。


Merge pull request #45546 from skipkayhil/decaffeinate-ujs

Action Viewの修正です。

rails-ujsのコードをCoffeeScriptから素のJS(ES2015 module)に変更しています。


Merge pull request #46009 from johnnyshields/bundler-use-windows-platform

railtiesの修正です。

GemfileでplatoformにWindowsを指定するのに、:mswin, :mswin64, :mingw, :x64_mingwを使用していたのを、そのaliasである:windowsを使用するよう修正しています。


Add link to 7.0 release notes in upgrade guide

rails guideのUpgrading Ruby on Railsの修正です。

Upgrading from Rails 6.1 to Rails 7.0セクションに、Rails 7.0のリリースノートへのリンクを追加しています。


Add link to 7.1 release notes in upgrade guide

rails guideのUpgrading Ruby on Railsの修正です。

Upgrading from Rails 7.0 to Rails 7.1セクションに、Rails 7.1のリリースノートへのリンクを追加しています。


Fix Active Record :db_runtime metric

Active Recordの修正です。

:db_runtime metricの為の値の保持をActiveRecord::LogSubscriberで行っていたのを、ActiveRecord::RuntimeRegistryで行うよう修正しています。