なるようになるブログ

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

rails commit log流し読み(2021/03/24)

2021/03/24分のコミットです。

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

activerecord/CHANGELOG.md

actionpack/CHANGELOG.md


Fix SQL result of Book.joins(reviews: :customer) query example

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

Joining Nested Associations (Single Level)の項にあるexampleコードの実行結果が実際の結果と異なっていたのを修正しています。


Prevent double save of cyclic associations

Active Recordの修正です。

associationの定義が循環している場合に、auto saveでrecordが二重に保存されてしまうバグがあったのを修正しています。


Exclude #saving? from API docs

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

内部APIであるAutosaveAssociation#saving?メソッドがAPI docに表示されないよう修正しています。


protected :can_save?

activerecord/lib/active_record/autosave_association.rbactiverecord/test/cases/autosave_association_test.rbの修正です。

can_save?メソッドの可視性をprotectedに変更、及び、テストから不要なグローバル変数の削除等を行っています。


Add _ prefix for the internal methods

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

内部用のメソッドに_ prefixを追加しています。同名のメソッドがユーザに定義されて処理が上書きされてしまうのを避ける為。


Merge pull request #41725 from okuramasafumi/add-more-examples-to-routes-shallow-doc

rails guideのRails Routing from the Outside Inの修正です。

Shallow Nestingの項に、サンプルのroutesで生成されるroutingの一覧を追加しています。


Document Destroy Async (#41680)

rails guideのActive Record Associationsの修正です。

dependentのオプションについて説明している箇所に、:destroy_asyncについての説明を追加しています。


Merge pull request #41745 from dylanahsmith/ar-class-inspection-filter

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

ActiveRecord::Base.filter_attributesにProcを指定している場合、Active Record objectのmarshal dump処理がエラーになってしまうバグがあったのを修正しています。


Merge pull request #40789 from csutter/deprecate-remote-ip-single-value

actionpack/lib/action_dispatch/middleware/remote_ip.rbの修正です。

config.action_dispatch.trusted_proxiesにsingle valueを指定するがdeprecateになりました。config.action_dispatch.trusted_proxiesにsingle valueを指定した場合とenumerableを指定した場合とで挙動が違う(デフォルトの値に追加する、とデフォルトの値を上書きする)のが混乱の元であり、single valueの方の挙動を維持する必要は無いだろう、との事でdeprecateになりました。