なるようになるブログ

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

rails commit log流し読み(2014/11/18)

2014/11/18分のコミットです。

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


Improve the performance of quoting table names on PG

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

rails 4.2のPostgreSQLのテーブル名のクォート処理で大きなperformance regressionが4.2が発生しており、その改善対応を行っています。

schemanilの場合に不要な連結処理を行わないよう対応、後はgsubを使用しないように対応、などを行っています。


Fix typo.

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

log_leve -> log_levelに修正しています。


document_root_element need to be public

Gemfileactionpack/lib/action_controller/test_case.rbの修正です。

document_root_elementメソッドをprivateメソッドからpublicに修正しています。

rails-dom-testingの方でdocument_root_elementをpublicで定義するよう修正が行われており、その対応のようです。


Use GitHub, not my local fork :sweat_smile:

Gemfileの修正です。

上記document_root_elementの対応で、誤ってGemfileのrails-dom-testingの引数にローカルのパスを指定してしまったので、githubを指定するよう修正しています。


Generate new applications with the right rails-dom-testing version

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

新規appを作成する際、githubrails-dom-testingを使用するよう修正しています。


Force table creation in tests

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

create_tableforce: trueオプションを追加しています。どうもテストで時折削除に失敗するケースがあるらしく、その為の対応との事です。


rm reorder_bind_params

ActiveRecordの修正です。

不要になったreorder_bind_paramsメソッドの呼び出しを削除しています。

Arel側が自動でハンドリングしてくれるためとのことです。うーんArelを元に処理しようとすると、結構影響出そうな。


Remove the unused second argument to substitute_at

ActiveRecordの修正です。

使用してないsubstitute_atメソッドの第二引数を削除しています。


[PERF] Speed up integer type casting from DB

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

DBの値をintegerにtype castする際の高速化の対応を行っています。が、正常に動作しないとの事で、後ほど直ぐrevertされています。


:nail_care: Put escape clause first, keeps @sgrif happy :grin:

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

上記高速化の続き。


Revert "[PERF] Speed up integer type casting from DB"

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

という訳で、上記二つの高速化の対応をrevertしています。


PERF: stop allocating the string "id" over and over

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

read_attributeメソッドの中で引数の属性名がidと一致するかチェックを行っているのですが、毎回idを定数に切り出して、その定数と比較するよう修正しています。

ID = 'id'.freeze

-        name = self.class.primary_key if name == 'id'
+        name = self.class.primary_key if name == ID

Stringの生成を抑える為との事。


fixed minor typos in RELEASE doc [ci skip]

RELEASING_RAILS.rdocの修正です。

タイポの修正のみです。