なるようになるブログ

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

rails commit log流し読み(2026/12/02)

2026/12/02分のコミットです。

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

activerecord/CHANGELOG.md


Relax Action View's Prism dependency constraint

actionview/actionview.gemspecの修正です。

prism gemの依存が1系に固定されていたのを、バージョン指定を削除して2系を使用出来るよう修正しています。


Fix interrupt_job_during_step with non-primitive cursors

activejob/lib/active_job/continuation/test_helper.rbの修正です。

interrupt_job_during_stepでcursor:にDate、Timeなどのprimitiveでない値を指定すると、ジョブが中断されずに最後まで実行されていたのを修正しています。


Fix first(n) on ordered disable_joins association scopes

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

disable_joinsを指定していて、through associationでorderが決まるassociationにfirst(n)を指定するととエラーになっていたのを修正しています。


Fix reverting t.change_default with :from and :to

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

change_table内のt.change_defaultや、change_column_defaultでfromとtoにhashを渡した場合に、両方指定していてもマイグレーションのrevert時にエラーになってしまっていたのを修正しています。


Fix line filtering of tests with a method call on their first line

railties/lib/rails/test_unit/test_parser.rbの修正です。

テスト名に#{format.upcase}のようなメソッド呼び出しを含む場合に、test runnerのlineを指定してのfilter処理が正しく動作していなかったのを修正しています。


Call from_node for Action Text attachables located in bulk (#60090)

Action Textの修正です。

ActionText::Contentでattached recordをbulkで取得するようになってから、取得したrecordでActionText::Attachable.from_nodeが呼ばれず、アプリケーション側でoverrideした場合にそのoverrideが呼ばれなくなってしまっていたのを修正しています。

rails commit log流し読み(2026/12/01)

2026/12/01分のコミットです。

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

actionpack/CHANGELOG.md

activerecord/CHANGELOG.md

actiontext/CHANGELOG.md


Merge pull request #60046 from G-Rath/csp-dev

Action Packの修正です。

Turbo Driveで表示されたリクエストでエラーが発生した場合に、遷移元ページのCSPが適用されてdebug pageが正しく表示されてなかったのを修正しています。


Merge pull request #59929 from jessewaites/reject-blank-http-basic-credentials

actionpack/lib/action_controller/metal/http_authentication.rbの修正です。

http_basic_authenticate_withとhttp_basic_authenticate_or_request_withのpasswordオプションに空文字を指定するのを許容していたのを、deprecateに、今後は空のパスワードは指定出来ないよう修正しています。誤って空のパスワードを許容しないようにするため。


Merge pull request #59148 from mhenrixon/ractor-shareable-empty-spacer

ractorize!後にnon-main Ractorからcollectionをrenderするとエラーになっていたのを修正しています


Merge pull request #59149 from mhenrixon/ractor-number-converter-format-key https://github.com/rails/rails/commit/aaa3ede4945b1f85371e26aed5a436af2f5e700d activesupport/lib/active_support/number_helper.rbの修正です。

ractorize!後にnon-main Ractorからnumber converterを呼び出すとエラーになっていたのを修正しています。


Merge pull request #59150 from mhenrixon/ractor-fragment-cache-keys

actionpack/lib/abstract_controller/caching/fragments.rbの修正です。

ractorize!後にnon-main Ractorからcacheヘルパーやread_fragmentなどを使うとエラーになっていたのを修正しています。


Merge pull request #59167 from mhenrixon/ractor-route-spec-to-s

actionpack/lib/action_dispatch/journey/path/pattern.rbの修正です。

ractorize!後にnon-main Ractorからrouteのpathを文字列化するとエラーになっていたのを修正しています。


Raise from ractorize! unless eager loading is enabled

railties/lib/rails/application.rbの修正です。

config.eager_load = falseなのにractorize!が使用された場合に、ractorize!でエラーをraiseするよう修正しています。


Merge pull request #59805 from mhenrixon/ractor-shareable-serialized-attributes

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

unshareable_proc_action = :raiseの場合にserializeやstoreを使用しているmodelがあるとractorize!がエラーになっていたのを修正しています。


Merge pull request #60049 from mhenrixon/ractor-params-deep-munge

actionpack/lib/action_dispatch/http/utils.rbの修正です。

ractorize!後にnon-main RactorでJSONのリクエストボディのパラメータをparseするとエラーになっていたのを修正しています。


Make controller renderers readable from non-main Ractors

actionpack/lib/action_controller/railtie.rb、 actionpack/lib/action_dispatch/routing/route_set.rbの修正です。

ractorize!後にnon-main Ractorからcontrollerのrendererを使用するとエラーになっていたのを修正しています。


Add named lock strengths to lock, lock! and with_lock

Ative Recordの修正です。

lock系のメソッドにsymbolでrow lockのstrengthを指定出来るよう修正しています。サポートしているのは:update、:share(PostgreSQL、MySQL)、:no_key_update(PostgreSQL)、:key_share(PostgreSQL)で、adapterがサポートしていないstrengthを指定した場合はArgumentErrorがraiseされるようになっています。

Account.lock(:no_key_update).find(1)  # SELECT ... FOR NO KEY UPDATE
account.with_lock(:share) { ... }     # FOR SHARE / LOCK IN SHARE MODE

Make renderers added with ActionController::Renderers.add callable from non-main Ractors

actionpack/lib/action_controller/metal/renderers.rbの修正です。

ractorize!後にnon-main Ractorからrender json:などRenderers.addで追加されたrendererを使うとエラーになっていたのを修正しています。


Merge pull request #48711 from shouichi/prefer-button-tag

railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.ttの修正です。

scaffoldで生成されるformのテンプレートで、submitボタンにform.submit(inputタグ)を使用していたのを、form.button(buttonタグ)を使用するよう修正しています。buttonタグであれば子要素を持てるため、Turboで送信中に付与されるdisabled属性に応じて表示を切り替える、といった事が出来るようになるため。


Merge pull request #54946 from skipkayhil/hm-or-or

Active Recordの修正です。

WhereClause#orでArel::Nodes::Orノードを組み立てる処理を直接行っていたのを、Arel::Nodes::Or#orとArel::Nodes::SqlLiteral#orを定義してそちらを使うよう修正しています。


Descriptive error when file cannot be decrypted

Active Support、railtiesの修正です。

ActiveSupport::EncryptedConfigurationでファイルの復号に失敗した場合に、どのファイルで失敗したのかをエラーメッセージに含むよう修正しています。


Merge pull request #58511 from excid3/action-text-locals

Action Textの修正です。

Action Textのcontentをrenderする際に、localsを指定出来るよう修正しています。指定したlocalsはattachmentのpartialでlocal_assignsから参照出来るようになっています。

<%= render @post.body, turbo_frame: :_top %>

<%# app/views/users/_user.html.erb %>
<%= link_to user.name, user, data: { turbo_frame: local_assigns[:turbo_frame] } %>

Validate only the requested formats when expanding /

actionview/lib/action_view/lookup_context.rbの修正です。

LookupContext#formats=で*/*をデフォルトのformatsに展開した後に全てのformatをバリデーションしていたのを、展開前に呼び出し元が指定したformatsのみをバリデーションするよう修正しています。


Make OrderedOptions#_get public

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

InheritableOptionsが親のOrderedOptionsから値を読む際に使用しているOrderedOptions#_getの可視性をprotectedからpublicに変更しています。protectedのチェックを無くして処理を高速化する為。


[ci skip][docs] Fix incorrect link style

rails guideのActive Storage Overviewの修正です。

リンクの書き方が誤っている箇所があったのを修正しています。


Merge pull request #60077 from 55728/fix-action-text-remote-image-alt

actiontext/app/views/action_text/attachables/_remote_image.html.erbの修正です。

attachmentがリモートの画像の場合にalt attributがrenderingされてなかったのを修正しています。


Merge pull request #60078 from 55728/fix-active-job-guide-continuation-cursor-example

rails guideのActive Job Basicsの修正です。

Job Continuationsでcursorを使用する場合のexampleコードが正しく動作しないコードになっていたのを修正しています。


Merge pull request #60079 from 55728/fix-active-job-guide-solid-queue-retry-on-example

rails guideのActive Job Basicsの修正です。

Solid Queueのretry_onのexampleコードで、存在しないNet::TimeoutErrorと削除済みの:exponentially_longerを使用していたのを、Net::OpenTimeoutと:polynomially_longerを使用するよう修正しています。


Merge pull request #60080 from 55728/fix-multiple-databases-guide-schema-dump-example

rails guideのMultiple Databases with Active Recordの修正です。

schema_dumpのexampleでパスの指定方法に誤りがあったのを修正しています。


Merge pull request #60081 from 55728/fix-querying-guide-sql-string-literal-quotes

rails guideのActive Record Query Interfaceの修正です。

SQL string literalsのexampleが正しく動作しないコードになっていたのを修正しています。


Fix typo in security.md

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

guide内のタイポを修正しています。

rails commit log流し読み(2026/11/30)

2026/11/30分のコミットです。

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

actionpack/CHANGELOG.md

activestorage/CHANGELOG.md


Don't throw away PostgreSQL index storage parameters

activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb、 activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rbの修正です。

PostgreSQL adapterでindexを取得する際に、indexのstorage parameterを捨ててしまっていたのを、PostgreSQL::IndexDefinitionにstorage_parametersとして保持するよう修正しています。


Add the STI type conditions after merging the association scope

Active Recordの修正です。

has many through associationのscopeでinheritance columnに対する条件を指定した場合に、STIのtype条件が上書きされて消えてしまっていたのを修正しています。


Add the STI type condition after merging the scope when preloading

activerecord/lib/active_record/associations/preloader/association.rb、 activerecord/lib/active_record/associations/preloader/branch.rbの修正です。

preload時に、associationのscopeでinheritance columnに対する条件を指定した場合に、STIのtype条件が消えてActiveRecord::SubclassNotFoundがraiseされてしまっていたのを修正しています。


Merge pull request #60054 from 55728/fix-action-mailer-guide-mailer-name-example

rails guideのAction Mailer Basicsの修正です。

Action Mailer View Helpersセクションのexampleコードで、使用するメソッド名に誤りがあったのを修正しています。


Merge pull request #59889 from bruno-costanzo/select-validation-missing-attribute

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

validation時にselectで取得していないカラムがnilとして扱われてしまっていたのを、ActiveModel::MissingAttributeErrorをraiseするよう修正しています。


Merge pull request #60028 from darronschall/check-json-param-key-encoding

actionpack/lib/action_dispatch/http/utils.rbの修正です。

query stringやformのkeyと同様に、JSON request parameterのkeyについてもencodingが正しいかをチェックするよう修正しています。


Merge pull request #60052 from 55728/fix-task-generator-trailing-empty-line

railties/lib/rails/generators/rails/task/templates/task.rb.ttの修正です。

task generatorで生成されるファイルで、namespaceブロックのendの前に空行が入りRuboCopの違反になっていたのを修正しています。


Scrub the invalid parameter key before using it in the error

actionpack/lib/action_dispatch/http/param_builder.rbの修正です。

query stringやformのkeyが不正なUTF-8の場合に、InvalidParameterErrorのメッセージにキーをそのまま埋め込んでいてメッセージ自体が不正なエンコーディングになっていたのを、不正なバイトをscrubしてから使用するよう修正しています。


Merge pull request #59909 from 55728/fix-polymorphic-action-helpers-override

actionpack/lib/action_dispatch/routing/polymorphic_routes.rbの修正です。

edit_polymorphic_pathやnew_polymorphic_path等のhelperをオプションなしで呼んだ場合に、overrideしたpolymorphic_path/polymorphic_urlが使われなくなっていたのを修正しています。


Pass the zone string to Time.new in Time.rfc3339

activesupport/lib/active_support/core_ext/time/calculations.rb、 activesupport/CHANGELOG.mdの修正です。

Time.rfc3339で、"Z"だけでなく"-00:00"のoffsetを指定した場合もUTCのtimeを返すよう修正しています。


Merge pull request #60030 from 55728/fix-callbacks-frozen-conditions-array

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

callbackのif/unlessにfreezeされたarrayを指定するとFrozenErrorになっていたのを修正しています。


Merge pull request #60055 from 55728/fix-api-scaffold-controller-location-with-model-name

railties/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.ttの修正です。

API-only applicationで--model-nameを指定してnamespace付きのcontrollerを生成した場合に、createアクションのlocationに存在しないURLヘルパーが使われていたのを修正しています。


Fix scaffold --model-name for a non-namespaced controller

railties/lib/rails/generators/named_base.rbの修正です。

namespaceの無いcontrollerに対して--model-nameを指定してscaffoldを実行した場合に動作しないコードが生成されていたのを修正しています。


Add ActiveStorage::Blob#pdf?

activestorage/app/models/active_storage/blob.rbの修正です。

content typeが"application/pdf"、またはPDFベースのファイルの場合にtrueを返すActiveStorage::Blob#pdf?を追加しています。


Merge pull request #60043 from thomasklemm/thomasklemm/query-cache-key-hash-once

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

bindを持つクエリのquery cacheのlookup時に、キーのhash値が2回計算されていたのを、SQL、bind、hash値を持つStructをキーにして1回だけ計算するよう修正しています。


Merge pull request #60026 from joshbarros/docs/59775-strip-tags

actionview/lib/action_view/helpers/sanitize_helper.rbのdocの修正です。

strip_tagsのdocにescape処理を行いHTML-safeな文字列を返すことについて追記しています。

rails commit log流し読み(2026/11/29)

2026/11/29分のコミットです。

CHANGELOGへの追加はありませんでした。


Use key-value order and group in the remaining API docs and guides

docの修正です。

reorder、unscopeなどのexampleコードで、orderやgroupにSQL文字列を渡していたのを、key-value形式を使うよう修正しています。


Fix flaky test_find_with_a_multiple_sets_of_composite_primary_key_wrapped_in_an_array_ordered

activerecord/test/cases/finder_test.rbの修正です。

flakyなtest_find_with_a_multiple_sets_of_composite_primary_key_wrapped_in_an_array_orderedテストを修正しています。


Fix the open example in the Active Storage guide [ci skip]

rails guideのActive Storage Overviewの修正です。

openメソッドのexampleコードが正しく動作しないコードになっていたのを修正しています。

rails commit log流し読み(2026/11/28)

2026/11/28分のコミットです。

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

actionmailer/CHANGELOG.md

activerecord/CHANGELOG.md

railties/CHANGELOG.md

activesupport/CHANGELOG.md


Let the Action Mailer test helper load without Active Job

Action Mailer、Active Jobの修正です。

ActionMailer::TestCaseや同期的なメール送信をActive Jobに依存せず使用出来るよう修正しています。


Rename default_order to fallback_order

Active Recordの修正です。

Add support for implicit order in scopesで追加されたdefault_orderをfallback_orderにリネームしています。この機能の影響でmodelでdefault_orderという名前のscopeを定義出来なくなってしまっていたため。


Merge pull request #60003 from yahonda/fix-server-test-restart-mtime-race

railties/test/application/server_test.rbの修正です。

flakyになっていたtest_restart_rails_server_with_custom_pid_file_pathを修正しています。


Merge pull request #59916 from jonasporto/docs-skip-action-conditions

actionpack/lib/abstract_controller/callbacks.rbのdocの修正です。

callbackのdoc内の:only/:exceptと:if/:unless`を併用した場合の挙動の説明が誤った内容になっていたのを修正しています。


Ignore a schema cache dump that can't be deserialized

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

存在しなくなったクラスを参照していたり等、何らかの問題でdeserialize出来ないschema cacheのdumpを読み込むとエラーになっていたのを、warningを出した上でdumpを無視し、データベースからschemaを読み込むよう修正しています。


Merge pull request #59953 from MIbtehajNasar/fix-59951-job-error-report-context

activejob/lib/active_job/execution.rbの修正です。

rescue_fromやretry_onなどでjobのエラーを処理中に報告されたエラーのcontextにjobが含まれていなかったのを、含まれるよう修正しています。


Merge pull request #59847 from czj/action-cable-test-server-broadcast

actioncable/lib/action_cable/connection/test_case.rbの修正です。

channelのテストでconnection.broadcastを呼ぶとエラーになっていたのを修正しています。


Merge pull request #59807 from yshmarov/fix-instant-lock-docs

docの修正です。

docでMySQLではエラーになるalgorithm: :instantとlock: :noneの組み合わせを使用していたのを修正しています。


Merge pull request #59738 from carlosdanielpohlod/action-view-helper-examples

docの修正です。

datetime_field、picture_tag、video_tagのdoc内のexampleコードで、出力結果が実際の出力と異なっていたのを修正しています。


Merge pull request #58935 from bastin27/fix-actionview-helper-doc-examples

docの修正です。

asset_path、number_to_currency、mail_to、sms_toなどのdoc内のexampleコードで、出力結果が実際の出力と異なっていたのを修正しています。


Build attribute Hashes without copying the lazy row

activemodel/lib/active_model/attribute_set.rbの修正です。

attributes_for_database、attributes_before_type_castで、呼び出しの度に全attributeを一時objectにコピーしてからhashにしていたのを、直接hashを生成するよう修正しています。


Add bin/rails credentials:keys to list credentials without their values

railtiesの修正です。

credentialsのキーを値なしで一覧表示するbin/rails credentials:keysコマンドを追加しています。キーはcredentials:fetchと同じドット区切りの形式で1行ずつ出力されます。


Merge pull request #59518 from sampokuokkanen/query-attribute-memoize-hash

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

QueryAttribute#hashの値をメモ化するよう修正しています。


Merge pull request #59432 from wtn/buffer

activesupport/lib/active_support/core_ext/string/output_safety.rbの修正です。

gsub!などでunsafeになったSafeBufferでencode、-@、dedup、+@を使用すると、結果がhtml_safe?になりエスケープされずに出力されてしまうバグがあったのを修正しています。


Merge pull request #59498 from amatsuda/fix-activemodel-inline-rbs

activemodel/lib/active_model/errors.rbのdocの修正です。

ActiveModel::ErrorsのRBSのsignatureについて、パース出来ないものや誤った内容があったのを修正しています。


Clear default_order when calling reorder

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

reorderでfallback_orderもクリアするよう修正しています。


Merge pull request #59369 from amatsuda/symbol-to-s-returns-name

Active Supportの修正です。

Ruby 4.1より前のバージョンで、Symbol#to_sがRuby 4.1と同様にSymbol#nameを返すよう修正しています。合わせて、この対応により不要になったsymbolの場合は#nameを使用する、というような処理を#to_sを使用するよう修正しています。


Fix the status code for :unprocessable_content in the Layouts and Rendering guide [ci skip]

rails guideのLayouts and Rendering in Railsの修正です。

unprocessable_contentのstatus codeが誤っていたのを修正しています。


Fix the return type annotation of SchemaContext#build_default_attributes

activerecord/lib/active_record/model_schema/schema_context.rbのdocの修正です。

SchemaContext#build_default_attributesのdoc内のRBSのsignatureに誤りがあったのを修正しています。


Remove Rack::Sendfile from the default middleware stacks in the guides [ci skip]

rails guideの修正です。

デフォルトのstackについて説明している箇所からRack::Sendfileを削除しています。


Use a class name in the wrapper_exceptions example in the configuring guide [ci skip]

rails guideのConfiguring Rails Applicationsの修正です。wrapper_exceptionsを設定するexampleコードが正しく動作しないコードになっていたのを修正しています。


Merge pull request #60040 from 55728/fix-action-view-overview-nested-layout-yield

rails guideのAction View Overviewの修正です。

nested layoutを使用するexampleコード内のタイポを修正しています。


Merge pull request #60039 from 55728/fix-mysql-remove-column-algorithm-and-lock

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

MySQL adapterのremove_columnでalgorithmとlockオプションが無視されていたのを修正しています。


Merge pull request #60038 from 55728/fix-credentials-keys-invalid-key-length

railties/lib/rails/commands/credentials/credentials_command.rbの修正です。

credentials:keys commandでcredentialsの読み取りに失敗した場合等に適切なエラーメッセージが出力されるよう修正しています。


Merge pull request #60035 from 55728/fix-sanitize-sql-array-arel-sql-bind-variables

activerecord/lib/active_record/sanitization.rb、 activerecord/lib/active_record/querying.rbの修正です。

sanitize_sql_arrayやfind_by_sqlなどに、bind variableを含むArel.sqlのstatementを配列で渡すとActiveRecord::PreparedStatementInvalidになっていたのを修正しています。


Merge pull request #60034 from 55728/fix-follow-redirect-headers-mutation

actionpack/lib/action_dispatch/testing/integration.rbの修正です。

follow_redirect!が引数で渡されたheadersのHashにHTTP_REFERERを直接追加しており、frozenなhashが渡された場合にとFrozenErrorになっていたのを修正しています。


Merge pull request #60033 from 55728/fix-select-tag-prompt-option-mutation

actionview/lib/action_view/helpers/form_tag_helper.rbの修正です。

select_tagで引数で渡されたoptionsのhashを直接変更しないよう修正しています。


Find exclusion constraints by name alone when removing them

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

PostgreSQLでwhereを指定して追加したexclusion constraintが、remove_exclusion_constraintやマイグレーションのrollbackで削除できなかったのを修正しています。


Merge pull request #60032 from 55728/fix-http-cache-forever-last-modified-in-place

actionpack/lib/action_controller/metal/conditional_get.rbの修正です。

http_cache_foreverがlast_modifiedに渡されたTimeをUTCに変換していたのを、渡されたTimeは変更しないよう修正しています。


Merge pull request #60024 from thomasklemm/thomasklemm/association-load-one-connection-lookup

activerecord/lib/active_record/associations/association.rb、 activerecord/lib/active_record/reflection.rbの修正です。

Association#find_targetでstatement cacheの取得と実行を別々のwith_connectionブロックで行っていたのを、同じブロック&同じコネクションで処理を行うよう修正しています。

rails commit log流し読み(2026/11/27)

2026/11/27分のコミットです。

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

actionmailbox/CHANGELOG.md

actionpack/CHANGELOG.md

actionview/CHANGELOG.md

activesupport/CHANGELOG.md

actionmailer/CHANGELOG.md

railties/CHANGELOG.md

activerecord/CHANGELOG.md


Bound quoted name cache entries by byte size

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

quoteしたカラム名、テーブル名のキャッシュについて、1KiBを超える名前はキャッシュしないよう修正しています。


Merge pull request #59962 from bruno-costanzo/fragment-cache-skip-unused-events

actionpack/lib/action_controller/log_subscriber.rb、 activesupport/lib/active_support/event_reporter/log_subscriber.rbの修正です。

enable_fragment_cache_loggingやlog_warning_on_csrf_failureでログ出力が無効になっている場合はevent reporterのeventを生成しないよう修正しています。


Merge pull request #59950 from mattyr/action-mailbox-conductor-routes-local-only

actionmailbox/lib/action_mailbox/engine.rb、 actionmailbox/config/routes.rbの修正です。

Action Mailboxのconductor用のroutesを、development及びtest環境でのみ定義、及び、bin/rails routesの結果に表示しないよう修正しています。


Merge pull request #59975 from yatmsu/hide-generator-flags-from-rails-new-help

railties/lib/rails/generators/rails/app/app_generator.rbの修正です。

rails new --helpにgenerator用のオプションが表示されないよう修正しています。


Merge pull request #59964 from bruno-costanzo/nested-attributes-scalar-id-lookup

activerecord/lib/active_record/nested_attributes.rb、 activerecord/lib/active_record/key.rbの修正です。

accepts_nested_attributes_forでのrecordのid比較処理について、single columnのidの場合はarrayに変換せずに比較するよう修正しています。


Merge pull request #59936 from 55728/fix-dirty-in-place-modification-doc-example

activemodel/lib/active_model/dirty.rbのdocの修正です。

ActiveModel::Dirtyのdocmodificationの例で、実際の戻り値とdocに記載されている値が異なっている箇所gああったのを修正しています。


Merge pull request #59983 from thomasklemm/thomasklemm/lease-registry-lockless-hit

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

LeaseRegistry#leaseで不要な場合はmutexの取得処理を行わないよう修正しています。


Merge pull request #59972 from bruno-costanzo/nested-default-deep-dup

activemodel/lib/active_model/attribute.rbの修正です。

JSONカラムなどのデフォルトnestした値がrecord間で共有されてしまていたのを、共有されないよう修正しています。


Merge pull request #59958 from bruno-costanzo/dup-lock-version-dirty-tracker

activemodel/lib/active_model/dirty.rbの修正です。

optimistic lockingを使用しているrecordをdupすると、コピーしたrecordのlock_versionがnilになってしまうバグがあったのを修正しています。


Give Live actions the event reporter context and tags of their request

Action Pack、Active Supportの修正です。

ActionController::Liveのactionで、Rails.eventのcontextとtagsに別のリクエストの値が使われてしまうバグがあったのを修正しています。


Merge pull request #59919 from milkcocoa/fix-action-view-strict-locals-block

Action Viewの修正です。

strict localsのデフォルト値でsafe navigation operatorを使用した場合に、unused blockのwarningが出力されてしまうバグがあったのを修正しています。


Return a plain String when truncate_bytes cuts an html_safe string

activesupport/lib/active_support/core_ext/string/filters.rbの修正です。

html_safeな文字列に対してString#truncate_bytesを使用すると、markupがescapeされ指定したバイト数を超える場合があったのを、String#truncateと同様にescapeしていないStringを返すよう修正しています。


Merge pull request #59952 from bastin27/fix-mailer-deliver-callbacks-without-mail

actionmailer/lib/action_mailer/base.rb、 actionmailer/lib/action_mailer/message_delivery.rbの修正です。

mailerのactionでmailが呼ばれなかった場合も、before_deliver、around_deliver、after_deliver等のコールバックが実行されていたのを、実行しないよう修正しています。


Merge pull request #59913 from 55728/fix-strong-parameters-nested-attributes-expect-doc

actionpack/lib/action_controller/metal/strong_parameters.rbのdoc修正です。

ActionController::StrongParametersのdocのaccepts_nested_attributes_forを使用したexpectのexmpleコードが正しく動作しない内容になっていたのを修正しています。


Honor DATE_FORMATS overrides of built-in formats

Active Supportの修正です。

Time::DATE_FORMATSやDate::DATE_FORMATSで:shortなどの組み込みのフォーマットを上書きしても反映されバグがあったのを修正しています。


Merge pull request #59911 from 55728/fix-message-pack-missing-namespaced-class

activesupport/lib/active_support/message_pack/extensions.rbの修正です。

MessagePackでseriralizeしたcacheについて、namespace付きのクラスが存在しない場合にキャッシュミスとして扱うよう修正しています。


Merge pull request #59908 from 55728/fix-response-content-type-non-string-header

actionpack/lib/action_dispatch/http/response.rbの修正です。

Content-TypeヘッダーにMime::Typeなど文字列以外の値を設定した場合にエラーになってしまうバグがあったのを修正しています。


Merge pull request #59903 from yahonda/fix-connection-pool-fiber-test-isolation-level-race

activerecord/test/cases/connection_pool_test.rbの修正です。

ConnectionPoolFiberTestでisolation levelを変更したタイミングによって、他のpoolのコネクションがリークし、以降のテストが大幅に遅くなる場合があったのを修正しています。


Merge pull request #59902 from hachi8833/revert_link_to_jemalloc_performance_guide

rails guideのTuning Performance for Deploymentの修正です。

guide内のjemallocへのリンクをfacebook/jemallocからjemalloc/jemallocに戻しています。jemallocのリポジトリがアーカイブ解除され再びアクティブになったため。


Merge pull request #59900 from fuzzyrichie/class-attribute-code-generator

activesupport/lib/active_support/core_ext/class/attribute.rbの修正です。

class_attributeで定義するメソッドをclass_evalでコンパイルしていたのを、ActiveSupport::CodeGeneratorを使って同じ属性名のメソッドをクラス間で共有するよう修正しています。


Don't share the query cache state with the ActionController::Live thread

actionpack/lib/action_controller/metal/live.rb、 activerecord/lib/active_record/railtie.rbの修正です。

ActionController::Liveのstreaming用のthreadがrequestのquery cacheを引き継いでしまい、stream内で同じレコードを繰り返し読み込むと古い結果が返ってしまうバグがあったのを修正しています。


Fix #33980: Parse escaped quotes in Accept headers

actionpack/lib/action_dispatch/http/mime_type.rbの修正です。

Acceptヘッダーのクォートされたパラメータ内にエスケープされた文字が含まれる場合に正しくパースできないバグがあったのを修正しています。


Merge pull request #58842 from rails/rmf-connection_pool

Active Supportの修正です。

connection_poolの実装をActive Supportに取り込み、connection_pool gemを依存から削除しています。Active Supportの依存を減らすため、との事です。


Merge pull request #59959 from wintan1418/document-s3-public-uploads-via-acl-default

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

config.active_storage.s3_public_uploads_via_aclのデフォルト値の説明がtrueのみになっていたのを、config.load_defaultsのバージョンごとのデフォルト値を記載するよう修正しています。


Declare Prism dependencies in Action View and Railties

railties/railties.gemspecの修正です。

prism gemのdependencyを指定しています。Ruby 4.1でprismがbundled gemになり、依存が無いとLoadErrorになってしまう可能性があるため。


Merge pull request #59627 from thomasklemm/thomasklemm/restore-max-password-length

activemodel/lib/active_model/secure_password.rbの修正です。

MAX_PASSWORD_LENGTH_ALLOWEDをBCryptPassword配下からActiveModel::SecurePasswordにも戻しています。この定数を参照しているアプリケーションがエラーにならないようにするため。


Merge pull request #59735 from thomasklemm/thomasklemm/upgrade-guide-pg-fixture-locks

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

PostgreSQL 18.4以降ではfixtureのロード時により多くのロックを取得するようになり、並列テストでout of shared memoryエラーになる場合がある旨説明を追加しています。


Merge pull request #59800 from thomasklemm/thomasklemm/lazy-indexed-keys

activemodel/lib/active_model/attribute_set.rb、 activemodel/lib/active_model/attribute_set/builder.rbの修正です。

LazyIndexedAttributeSet#keysで呼び出しのたびに不要なarrayを生成していたのを修正しています。


Allocate less per field in text_field_tag and tag

actionview/lib/action_view/helpers/form_tag_helper.rb、 actionview/lib/action_view/helpers/tag_helper.rbの修正です。

text_field_tagやtagで不要な計算やオブジェクトの生成を行わないよう修正しています。


Merge pull request #59984 from thomasklemm/thomasklemm/upgrade-guide-sidekiq-8-0-3

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

8.2ではSidekiq 8.0.3以降が必要な旨と、Sidekiqを初期化前にrequireしておく必要がある旨説明を追加しています。


Merge pull request #59985 from thomasklemm/thomasklemm/upgrade-guide-sendfile-unset

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

x_sendfile_headerが未設定の場合はRack::Sendfileがミドルウェアに含まれなくなり、insert_before Rack::Sendfileなどが起動時にエラーになる旨説明を追加しています。


Merge pull request #59812 from thomasklemm/thomasklemm/fix-flaky-ci-tests

actionpack/test/dispatch/server_timing_test.rbの修正です。

ServerTimingTestでヘッダーの値をsleepの長さと固定の許容範囲で比較していたため負荷の高い環境でテストが失敗する場合があったのを修正していmす。


Merge pull request #59817 from thomasklemm/thomasklemm/fix-ractor-proxy-unpin

activerecord/lib/active_record/connection_adapters/ractor_connection_handler/proxy.rb、 activerecord/lib/active_record/connection_adapters/ractor_connection_handler/proxy_connection_pool.rbの修正です。

Ractorのconnection proxyでunpinした際にpoolのunpinが行われず、writing poolがpinされたままになってしまっていたのを修正しています。


Keep navigation helpers available through UrlHelper

actionview/lib/action_view/helpers/url_helper.rbの修正です。

link_toやbutton_toなどがNavigationHelperに移動された影響で、UrlHelperやFormHelperを直接includeしているクラスでこれらのメソッドが使えなくなっていたのを修正しています。


Note in the upgrade guide that Action Mailer no longer loads Active Job

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

Action MailerがActive Jobのrailtieをロードしなくなったため、active_job/railtieを明示的にrequireする必要がある旨説明を追加しています。


Merge pull request #59987 from thomasklemm/thomasklemm/mailer-delivery-job-without-active-job

railties/lib/rails/application/configuration.rbの修正です。

config.load_defaultsでconfig.action_mailer.delivery_jobの設定をしないよう修正しています。設定内容がもうAction Mailerでデフォルト値になっており設定が不要、かつ、Action Mailerのロード時にActive Jobもロードされてしまい、activejob gemなしでAction Mailerが使えない、という問題があったため。


Merge pull request #59569 from thomasklemm/thomasklemm/association-scope-lazy-alias-tracker

activerecord/lib/active_record/associations/association_scope.rb、 activerecord/lib/active_record/associations/disable_joins_association_scope.rbの修正です。

AssociationScope#scopeで、throughではない関連付けで使わないAliasTrackerを生成しないよう修正しています。


Merge pull request #59661 from thomasklemm/thomasklemm/parameter-parsers-register-in-place

actionpack/lib/action_dispatch/http/parameters.rb、 actionpack/lib/action_dispatch/railtie.rbの修正です。

ActionDispatch::Request.parameter_parsersがfreezeされた影響で起動時にparameter_parsers[:jsonapi]経由でにパーサーを登録するとFrozenErrorになっていたのを、ractorize!が呼ばれるまではパーサーを変更出来るよう修正しています。


Merge pull request #59824 from thomasklemm/thomasklemm/form-builder-field-names

actionview/lib/action_view/helpers/form_tag_helper.rb、 actionview/lib/action_view/helpers/tags/base.rbの修正です。

form builderのfieldのid、nameを生成する際に、変更が不要な場合はstringのコピーを行わないよう修正しています。


Don't compare owner conditions when joining an association without a scope

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

関連先のdefault scopeに範囲外の値の条件がある場合に、関連付けをjoinsするとエラーになってしまうバグがあったのを修正しています。


Skip merging a blank relation into a relation without conditions

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

条件のないrelationに空のrelationをmergeする場合にearly returnするよう修正しています。


Merge pull request #59832 from thomasklemm/thomasklemm/errors-messages-for-no-errors

activemodel/lib/active_model/errors.rbの修正です。

エラーがないmodelでerrors[attr]を呼んだ場合にearly returnして不要なオブジェクトを生成しないよう修正しています。


Let a temporary SQLite table or view hide a permanent one in the schema readers

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

SQLiteで通常のtableと同名のtemporary tableがある場合に、schema取得時にcolumnやindexが重複して正しく結果が取得出来ないバグがあったのを修正しています。


Merge pull request #59976 from thomasklemm/thomasklemm/index-definition-adapter-readers-2

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

lengthsやtypeなどのIndexDefinitionのreaderがadapter固有のクラスに移動された影響で、それ以外のadapterそれらのメソッドを呼ぶとNoMethodErrorになってしまっていたのを修正しています。


Keep the UTC offset in Time#change for times with a zone object

activesupport/lib/active_support/core_ext/time/calculations.rbの修正です。

zoneオブジェクトを持つTimeで、DST終了時に繰り返される時間帯の値に対してTime#changeを呼ぶとTZInfo::AmbiguousTimeになったり、時間が1時間ずれたりしてしまうバグがあったのを修正しています


Fix the attribute_method_affix example in Active Model docs [ci skip]

activemodel/lib/active_model/attribute_methods.rbの修正です。

attribute_method_affixメソッドのdoc内のexampleコードで処理が不足している箇所があったのを修正しています。


Merge pull request #59884 from smyk-git/fix-sti-type-condition-in-join-scope

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

STIのsubclassへのassociationのscopeにinheritance columnの条件がある場合に、joinsやeager_loadでSTIのtypeの条件が失われてしまうバグがあったのを修正しています。


Don't freeze serialized column defaults

Active Model、Active Recordの修正です。

serializeされた型ではデフォルト値をfreezeしないよう修正しています。デフォルト値がfreezeされるとcoderによってはカラムのデフォルト値と異なる値になるという問題があったため。


Add missing Active Support core extension requires

Action Pack、Active Supportの修正です。

不足していたrequireを追加しています。


Note in the upgrade guide that default_url_options is frozen by default

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

default_url_optionsがデフォルトでfreezeされたHashになり、直接変更するとFrozenErrorになることと、及び、代わりの設定方法についての説明を追加しています。


Find SQLite tables by any ASCII case of their name in the schema readers

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

SQLite3 adapterで、大文字を含むようなテーブルを作成した場合に、大文字小文字が異なってもテーブルやindexの取得が出来るよう修正しています。


Let Attachment.from_node pick attachables the bulk lookup didn't locate

actiontext/lib/action_text/content.rbの修正です。

ActionText::Attachment.from_nodeをoverrideして独自のattachableを返すようにしていた場合にそのoverrideが使われなくなってしまっていたのを修正しています。


Bump the minimum supported SQLite version to 3.37.0

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

SQLite3 adapterでサポートするSQLiteの最小バージョンを3.37.0に変更しています。Rails 8.0からpragma_table_listを使用しており、3.37未満だと正しく動作しないため。


Fix Time.now(in:) raising inside travel_to

activesupport/lib/active_support/testing/time_helpers.rbの修正です。

travel_to、travel、freeze_timeのブロック内でTime.now(in: "+09:00")のように引数を指定するとエラーになっていたのを修正していまうs.


Fix row_count and exception in sql.active_record for async queries

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

load_asyncなどのasync queryについて、sql.active_recordイベントのpayloadが正しく設定されてなかったのを修正しています。


Fix receive_inbound_email_from_fixture raising when given a status

actionmailbox/lib/action_mailbox/test_helper.rbの修正です。

receive_inbound_email_from_fixture、receive_inbound_email_from_sourceにstatusを指定するとArgumentErrorになっていたのを修正sています。


Fix bin/rails notes raising on invalid bytes in a Ruby file's comment

railties/lib/rails/source_annotation_extractor.rbの修正です。

Rubyファイルのコメントに不正なUTF-8のバイトが含まれていると、bin/rails notesがエラーになっていたのを修正しています。


Fix collection options with a Proc for both value_method and selected

actionview/lib/action_view/helpers/form_options_helper.rbの修正です。

options_from_collection_for_selectやcollection_selectで、value_methodとselectedの両方にProcを指定するとエラーになっていたのを修正しています。


Fix the error type examples in full_messages_for and messages_for docs [ci skip]

activemodel/lib/active_model/errors.rbの修正です。

ActiveModel::Errors#full_messages_for及び#messages_forのdocのexampleコードで、実際には発生しないエラーを使用していたのを修正しています。

rails commit log流し読み(2026/11/26)

2026/11/26分のコミットです。

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

actionpack/CHANGELOG.md

activesupport/CHANGELOG.md

railties/CHANGELOG.md

activejob/CHANGELOG.md

activerecord/CHANGELOG.md


Document redirect settings for metal controllers (#59977)

actionpack/lib/action_controller/metal.rbのdocの修正です。

ActionController::Metalのdoc内のredirectのexampleについて、action_on_open_redirectなどのリダイレクト関連の設定を追加&なぜその設定が必要かの説明を追加しています。


Match Rack::BadRequest errors in ActionDispatch::ParamError

actionpack/lib/action_dispatch/http/param_error.rbの修正です。

request parameterのパース中にRack::Multipart::BoundaryTooLongErrorなどのエラーが発生した場合に500エラーになっていたのを、400を返すよう修正しています。


Merge pull request #59971 from saddestmartian/action-text-ordered-list-linear-numbering

actiontext/lib/action_text/plain_text_conversion.rbの修正です。

長い番号付きリストを含むAction Textのrich textをplain textに変換する際、リスト項目の番号付けをlibxml側で行うよう修正しています。高速化のため。


Merge pull request #59925 from 55728/fix-ci-parallel-group-shared-step-title

activesupport/lib/active_support/continuous_integration/group.rbの修正です。

config/ci.rbのparallelなgroup内で同じタイトルのstepが同時に実行されるとエラーになってしまうバグがあったのを修正しています。


Rescue all Redis errors in RedisCacheStore failsafe

activesupport/lib/active_support/cache/redis_cache_store.rbの修正です。

Add compatibility layers for RedisClient::Pooled and RedisClient::Has…の修正により、RedisCacheStoreでRedisのメモリ不足や認証エラーなど接続エラー以外のエラーが発生した場合に例外がそのままraiseしていたのを、以前と同様にエラーをrescueしてキャッシュミスとして扱うよう修正しています。


Merge pull request #59960 from wintan1418/fix-datetime-type-docs

activemodel/lib/active_model/type/date_time.rbのdocの修正です。

ActiveModel::Type::DateTimeのdocの例で、hourとzoneの値が実際の値と異なっていたのを、正しい値に修正しています。


Merge pull request #59956 from bruno-costanzo/eager-load-outer-join-aliases

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

同じテーブルに対してleft_joinsとeager_loadを併用した場合に、where(users: ...)などでテーブル名を指定した条件がeager_loadの方のテーブルに適用されるようになっていたのを、Rails 8.1と同様にleft_joinsの方にaliasなしのテーブル名を使うよう修正しています。


Check the encrypted file key length when decrypting

Active Support、railtiesの修正です。

ActiveSupport::EncryptedFileで長さが正しくないキーでも読み込み出来てしまっていたのを、読み込み時にもInvalidKeyLengthErrorをraiseするよう修正しています。合わせて、credentials:editやencrypted:editなどのコマンドでキーの長さが正しくない場合に、エディタを開く前に適切なエラーを表示するよう修正しています。


Merge pull request #59906 from 55728/fix-order-sql-literal-ordering-references

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

order(Arel.sql("...").desc)のようにSQLリテラルを指定して並び替えた場合に、includesがpreloadではなくJOINでロードされるようになっていたのを、Rails 8.1と同様の挙動になるよう修正しています。


Fix preloading ordered has_many :through scoped on its through table

activerecord/lib/active_record/associations/preloader/through_association.rbの修正です。

through先のテーブルへの条件を含むscopeを持つhas_many :throughをpreloadした場合に、scopeが正しくエラーになったりしてしまうバグがあったのを修正しています。


Merge pull request #59961 from bruno-costanzo/active-job-locate-records-in-bulk

activejob/lib/active_job/arguments.rbの修正です。

MyJob.perform_later(users)のようにrecordのarrayをjobに渡した場合に、job実行時にレコード毎にクエリが実行されていたのを、model毎に1回のクエリでロードするよう修正しています。


Keep readonly when preloading a filtered through

activerecord/lib/active_record/associations/preloader/through_association.rbの修正です。

conditionが指定されたreadonlyなhas_many :throughをpreloadした場合に、readonlyではないレコードが返されてしまうバグがあったのを修正しています。


Apply the rest of the scope of a disable_joins association

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

disable_joinsを指定したassociationをlazy loadした場合に、スコープの条件と並び順以外のselect、limit、includes、readonly、strict_loadingなどが無視されてしまうバグがあったのを修正をしています。


Add enforced option to add_check_constraint on PostgreSQL 18+

Active Recordの修正です。

PostgreSQL 18以降でadd_check_constraintにenforcedオプションを指定出来るよう修正しています。enforced: falseを指定すると制約がNOT ENFORCEDで作成され、レコードの挿入・更新時にチェックされなくなります。


Add change_check_constraint for PostgreSQL 19+

Active Recordの修正です。

PostgreSQL 19以降で、既存のcheck constraintをENFORCEDとNOT ENFORCEDの間で切り替えるためのchange_check_constraintメソッドを追加しています。ENFORCEDに変更すると、既存の全行がチェックされるようになっています。


Fix the :content_type description in register_encoder docs [ci skip]

actionpack/lib/action_dispatch/testing/integration.rbのdocの修正です。

register_encoderメソッドのdoc内のcontent_typeオプションについての説明内のタイポを修正しています。G


Don't run a query when checking or compatibility

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

fromにassociation relationを指定したrelationでRelation#orを使用した場合に不要なクエリが実行されないよう修正しています。