なるようになるブログ

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

rails commit log流し読み(2018/05/27)

2018/05/27分のコミットです。

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


Fix belongs_to_counter_cache_after_update to respect polymorphic type change

Active Recordの修正です。

polymorphic association + counter cacheを使用している場合に、polymorphicのtypeを変更した場合にcounter cacheの更新が正しく行われないバグがあったのを修正しています。


Fix inconsistent touching behavior between assigning and unassigning

activerecord/lib/active_record/associations/belongs_to_association.rbactiverecord/lib/active_record/associations/builder/belongs_to.rbの修正です。

belongs_to associationにtouchオプションを指定している、かつ、associationのオブジェクトを変更した場合に、変更元のオブジェクトはtouchされて変更後のオブジェクトをはtouchされない、という挙動になっていたのを、どちらもtouch処理が行われるよう修正しています。


Fix that association's after_touch is not called with counter cache

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

counter cacheを使用している場合に、associationのafter_touch callbackが実行されないバグがあったのを修正しています。