なるようになるブログ

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

rails commit log流し読み(2017/01/03)

2017/01/03分のコミットです。

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


Remove duplicated test

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

重複していたstructure_loadに関するテストを削除しています。


Fix update counters of multiple records with touch: true

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

update_countersメソッドに複数レコードを指定 + touch: trueオプションを指定した場合に正しくcounterの更新処理が行われないバグがあったのを修正しています。


Push current_time_from_proper_timezone and timestamp attributes methods up to class method

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

current_time_from_proper_timezoneメソッド及びtimestamp attributesに関するメソッド(timestamp_attributes_for_createtimestamp_attributes_for_update等)をインスタンスメソッドからクラスメソッドに変更しています。処理の内容的にインスタンスを作成する必要は無い為との事です。


Counter cache touching don't need object finding anymore

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

counter cacheのtouch処理でfindでobjectを生成していたのを、生成しないよう修正しています。先のtimestamp attributes関連メソッドをクラスメソッドに移行した対応により、インスタンスを作成する必要が無くなった為。


Cache results of computing model type

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

STIを使用している、かつ、store_full_sti_classオプションがfalseの場合に、model typeの計算結果をキャッシュするよう修正しています。インスタンスの生成処理の速度をあげれるようにする為、との事です。


Prevent duplicate data-disable-with attributes

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

submit_tagメソッドにdisable_withオプションをHashで指定した場合(data: { disable_with: "..." }))に、data-disable-with attributesが複数タグに定義されてしまうバグがあったのを修正しています。