なるようになるブログ

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

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

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

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

railties/CHANGELOG.md

activerecord/CHANGELOG.md


Don't mess with column_defaults when optimistic locking is enabled

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

options lockを使用している時の処理を整理しています。

Lock情報を管理するためのLockingTypeクラスを新規に作成しています。


Add test cases for Migration#inverse_of https://github.com/rails/rails/commit/c195317a56061593316d7b5d163d868022010132

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

Migration#inverse_ofメソッドのテストケースを追加しています。


Use column_defaults in dirty for checking changed defaults

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

デフォルトの値から変わったかどうかのチェック処理で、column_defaultsの値を使用するよう修正しています。

もともとはcolumnsの値を使用していたのですが、column_defaultsの値が上書きされている事は無いとの事でcolumn_defaultsを使用するようになっているようです。


Don't assume that Hstore columns have always changed

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

hstore_to_stringメソッドを修正しています。Hstoreカラムの値が、カンマ区切りの値で戻ってくる事を想定したのですが、実際はカンマ+スペースだったらしく、カンマ+スペースでjoinするよう修正しています。


[ci skip] fix doc for the Hash#assert_valid_keys

Hash#assert_valid_keysメソッドのdocの修正です。

説明を修正しています。より分かりやすくしている感じですかね。


Fix documentation from #15669 [ci skip]

またしてもHash#assert_valid_keysメソッドのdocの修正です。

結局元の説明にほぼほぼ戻しています。


Move array database type casting to the Array type

ConnectionAdapters::PostgreSQL::Castクラスで行っていたArrayの変換処理をConnectionAdapters::PostgreSQL::OID::Arrayに移動しています。


Don't type cast the default on the column

ActiveRecordの修正です。

デフォルト値を持つカラムに対してして、type cast処理を行わないよう修正しています。

decoratorを使用する際の事を考慮して、であってるかなあ。


Merge pull request #15716 from schuetzm/skip-turbolinks

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

turbolinksのインストールをskipする為の、--skip-turbolinksオプションが追加されました。

こちらについては、再度修正が行われているので、詳しくは後ほど。


Ensure OID::Array#type_cast_for_database matches PG's quoting behavior

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

OID::Array#type_cast_for_databaseメソッドで使用するデリミッターをコンストラクタの生成時に指定出来るよう修正しています。


Add a generic --skip-gems options to generator

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

generatorに--skip-gemsオプションを追加しています。

インストールを入れたくないgemをgenerator時に指定出来るようになりました。

turbolinksを入れたくない場合は、以下のような形です。

rails new my_app --skip-gems turbolinks

:scissors:

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

不要なスペースの削除。


initialize the right variable

railties/test/railties/railtie_test.rbの修正です。

値を設定している変数を誤っていたのを修正しています。


Detect mutations of arrays and array members

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

PgArrayParserのrequire処理を、type_cast_for_databaseメソッド内でやっていたのを、クラス配下に移動しています。


Enable hstore in array tests

activerecord/test/cases/adapters/postgresql/array_test.rbの修正です。

Hstoreを使用出来るよう、テスト内で@connection.enable_extension 'hstore'を追加しています。


Deprecate Rails::Rack::LogTailer

railties/lib/rails/rack/log_tailer.rbの修正です。

Rails::Rack::LogTailerクラスがdeprateになりました。

そもそもRails4ではもう使用されていないようです。Rails5で削除予定


Detect in-place changes on point types

activerecord/lib/active_record/connection_adapters/postgresql/oid/point.rbactiverecord/lib/active_record/connection_adapters/postgresql/cast.rbの修正です。

Point型の変換処理を修正しています。


Reconnect after possibly enabling hstore

activerecord/test/cases/adapters/postgresql/array_test.rbの修正です。

hstoreを有効化したあと、@connection.reconnect!メソッドを呼び出してコネクションを再設定しています。


Titling the model name in views generated by scaffold.

scaffoldで生成されるtemplateファイルを修正しています。

h1タグの値をsingular_table_nameからsingular_table_name.titleizeに修正しています。

"Listing user_profiles"より、"Listing User Profiles"の方が良いのでは、という事です。


Merge pull request #15709 from zuhao/refactor_actionview_compiled_templates_test

actionview/test/template/compiled_templates_test.rbの修正です。

ActionView::LookupContext::DetailsKey.clearメソッドの呼び出しをteardownに移動しています。


Extract out with_env_tz helper method.

ActiveSupportのテストの修正です。

各テストファイルで行っていたtime zoneの設定/設定戻し処理を activesupport/test/time_zone_test_helpers.rbに集約しています。