なるようになるブログ

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

rails commit log流し読み(2024/11/16)

2024/11/16分のコミットです。

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

activesupport/CHANGELOG.md

railties/CHANGELOG.md

activerecord/CHANGELOG.md

actionpack/CHANGELOG.md


Merge pull request #53587 from calebhearth/more-explicit-upgrade-notes-about-encryption

rails guideのRuby on Rails 7.1 Release NotesUpgrading Ruby on Railsの修正です。

ActiveRecord::Encryptionで使用されるhash digestのデフォルトが変更になっている事の説明と、変更後のhash digestを使用する為に必要な対応についての説明を追加しています。


Merge pull request #53065 from larouxn/add_active_support_notifications_event_assertions

activesupport/lib/active_support/test_case.rbactivesupport/lib/active_support/testing/notification_assertions.rbの修正です。

特定のパターンとpayloadでActiveSupport::Notificationsがemitされたか(またはされてないか)どうかをテストで確認するためのassertionメソッドを追加しています。追加されたのは、assert_notificationassert_notifications_count、及び、capture_notificationsです。

assert_notification("post.submitted", title: "Cool Post") do
  post.submit(title: "Cool Post") # => emits matching notification
end

Merge pull request #53621 from p8/railties/only-include-permission-policy-middleware-if-present

Action Pack、railtiesの修正です。

initializerでpermission policyの設定が定義されている場合のみ、::ActionDispatch::PermissionsPolicy::Middlewareをincludeするよう修正しています。


Merge pull request #53555 from Earlopain/update-configuring-guide-defaults

rails guideのConfiguring Rails Applicationsの修正です。

config.active_record.query_log_tags_enabled及びconfig.active_support.disallowed_deprecationについての説明を、Rails 8.0で新規にアプリケーションを作成した場合のenvironment filesの設定内容と合うよう修正しています。


Merge pull request #53557 from gabrielso/authentication_avoid_query

railties/lib/rails/generators/rails/authentication/templates/app/controllers/concerns/authentication.rb.ttの修正です。

authentication generatorが生成するコード内のcookieに設定されたsession idを使用してのセッションの取得処理で、cookieに該当のsession idが無い場合、セッションの取得処理を行わないよう修正しています。


Merge pull request #53563 from Uaitt/point-to-ruby-3.3.6-documentation-in-rails-guides

docの修正です。

docs.ruby-lang.org へのリンクを指定している箇所が、特定のRubyのバージョンのdocへのリンクになっていたのを、バージョンの指定を削除(常に最新バージョンへのリンクになる)するよう修正しています。


Prefer official Ruby documentation

docの修正です。

docのリンク先にwww.ruby-doc.orgを使用している箇所があったのを、docs.ruby-lang.orgに修正しています。


Fix non-ascii char column name in deferred foreign key

activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rbの修正です。

カラム名にascii外の文字を使用していた場合に、deferrable foreign keyの設定がdumpファイルに出力されないバグがあったのを修正しています。


Add affected_rows to sql.active_record

Active Recordの修正です。

sql.active_record notificationのpayloadにaffected_rows(影響があった行数)を追加しています。クライアントに処理結果の件数は返さないのでrow_countではわからない、しかし大量のデータ更新等、 レプリケーションの遅延などに影響が出るかもしれないSQLをチェック出来るようにする為、との事です。


Don't parse response content type if value comes from Mime

Action Packの修正です。

Mime typeのsymbolの値をcontent typeに指定出来るよう修正しています。

response.content_type = :html

この場合、stringと異なり正規表現を使用してのmime typeのパース処理が行われない為、stringの場合より少し処理が高速になるようになっています。


Merge pull request #52893 from boddhisattva/add_docs_explain_with_buffer_option_in_postgres

rails guideのActive Record and PostgreSQLの修正です。

explainメソッドの使いかたについての説明を追加しています。


Remove test_unit plugin_generator

railtiesの修正です。

現在は使用していない古いplugin用のテストファイルのgeneratorを削除しています。


Allow to reset cache counters for multiple records

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

reset_countersメソッドに複数のレコードのidを指定出来るよう修正しています。

Aircraft.reset_counters([1, 2, 3], :wheels_count)