なるようになるブログ

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

rails commit log流し読み(2018/02/26)

2018/02/26分のコミットです。

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

activerecord/CHANGELOG.md


Remove native Array#sum and Enumerable#sum detection (#32102)

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

Array#sum、及び、Enumerable#sumが定義されているかのチェック処理を削除しています。

masterはRuby 2.4.1のみをサポートしており、上記メソッドは必ず定義されている為。


Association creation and finding should work consistently (#32048)

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

associationの作成及び取得処理でstore_full_sti_classの設定が無視されていたのを、store_full_sti_classの設定を反映するよう修正しています。

元々eager loadingやpreloadingではstore_full_sti_classの設定を使用するようになっており、挙動を合わせる為。


Merge pull request #31895 from kamipo/do_not_attempt_to_find_inverse_of_polymorphic

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

polymorphic associationに対してreflection.klassを取得しようとした場合に、ArgumentErrorをraiseするよう修正しています。

Rails 5.2.0.rc1でpolymorphic associationのcreate処理でエラーになる、というリグレッションが発生しました。これは色々な要因による複合条件で発生したリグレッションらしいのですが、そもそも取得出来るはずのないklassが取得出来てしまっていたのが根本的な原因だろう、という事で、polymorphic associationについてはklassが取得出来ないよう対応しています。


Active Model: Use private attr_reader

Active Modelの修正です。

attr_readerの可視性がprotectedになっていたのをprivateに修正しています。

Ruby 2.2以下でprivate attribute?のwarningが出てしまう為protectedにしていたのですが、masterでサポートしているバージョンは2.3以上になった為、privateに修正しています。


Remove changelogs for Rails 6.0 since they were backported to 5-2-stable

各CHANGELOから5.2にバックポートされたエントリーを削除しています。


Fix "NameError: uninitialized constant Categorization::Category"

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

不足していたmodels/categoryのrequireを追加しています。