なるようになるブログ

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

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

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

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


Use ActionDispatch::IntegrationTest http helper methods

actionpack/test/dispatch/prefix_generation_test.rbの修正です。

prefix生成に関するテストで、テストにRack::Test::Methodsを使用していたのを、ActionDispatch::IntegrationTestのhelperメソッドを使用するよう修正しています。

ActionDispatch::IntegrationTest + Rack::Test::Methodsを組み合わせると、Ruby本体のdef_delegatorsに関するバグを踏んでしまう事があり、時折テストがコケてしまう、という問題があった為ActionDispatch::IntegrationTestを使用しないよう修正したとの事です。

参考:Bug #13107: def_delegators causes random errors in MRI 2.4.0


Various style + grammar fixes for #27719

rails guideのAction Cable Overviewの修正です。

Adapter Configurationの項のフォーマット、グラマーの修正を行っています。


Add CHANGELOG entry for #24743

activerecord/CHANGELOG.mdの修正です。

SQLiteでもforeign key作成処理用出来るよう対応した、SQLite: Foreign Key Supportの対応についてのエントリーを追加しています。


Make Yarn quieter during precompilation as that is typically run by a deploy tool like Capistrano and we dont need the play-by-play

railties/lib/rails/tasks/yarn.rakeの修正です。

yarn:install taskでyarnコマンドを実行する際に、--no-progressオプションを指定し進行状況を表示しないよう修正しています。


Allocation free Integer#to_s

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

ActiveSupport::NumericWithFormat#to_sメソッドの引数指定が可変長引数になっていたのをキーワード引数に変更、及び分岐処理の整理を行っています。

-  def to_s(*args)
-    format, options = args
-    options ||= {}
-
+  def to_s(format = nil, options = nil)
     case format

可変長引数を使用してしまうと、その値を変数に入れる際にObjectの割り当てが発生してしまうので、不要なObjectの割り当てを減らす為に可変長引数を使用するのを止めた、との事です。


Merge pull request #27384 from matthewd/bigint-pk-tweaks

Active Recordの修正です。

明示的にPrimary Keyを指定しないようにした場合もPrimary Keyが設定されてしまっていたのを修正、及び、Primary KeyにInteger系の型(integerbigint等)を指定した場合に、auto incrementオプションを指定するよう修正しています。


Revert "Merge pull request #27718 from kamipo/remove_internal_public_methods"

ActiveRecord::ConnectionAdapters::SchemaStatements moduleからinitialize_schema_migrations_tableinitialize_internal_metadata_tableメソッドを削除した、 Remove initialize_schema_migrations_table and initialize_internal_metadata_table internal public methodsをrevertしています。

内部向けAPIでだったとしてもAPI docに表示されていたメソッドであった為、deprecate無しで削除するのはよくないだろう、という事でrevertされています。後ほどdeprecateにする対応をコミットされています。