なるようになるブログ

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

rails commit log流し読み(2014/07/08)

2014/07/08分のコミットです。

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


always test against a routed rack app so there are always url_helpers

action packのテストの修正です。

テストの際に、routing情報を保持したrack appを使用するよう修正しています。helper系のメソッドの確認をする為のようです。


remove the mounted_helpers respond_to check

actionpack/lib/action_dispatch/testing/integration.rbの修正です。

if app.routes.respond_to?(:mounted_helpers)を削除しています。先ほどのコミットでテストで使用するappは必ずrouting情報を保持するよう対応しているので、チェック処理は不要の為。


test i18n against a routed app

actionmailer/test/i18n_with_controller_test.rbの修正です。

テスト用にRoutedRackAppクラスを作成しています。


Merge pull request #16072 from sgrif/sg-xml-quoting

PostgreSQLのConnectionAdapterの修正です。

XML型を取り扱う為のXmlクラスを新規に作成しています。PostgreSQLは型が多いので、対応大変そうですねえ。


Merge pull request #16071 from sgrif/sg-pg-type-cast

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

Quotingクラスからtype_castメソッドを削除しています。

nilのケースの時の為の対応としてメソッドを追加していたのですが、現状、nilについてはArray type objectで対応しているので、不要になったようです。


Warm up cache to prevent assertion failure.

activerecord/test/cases/associations/nested_through_associations_test.rbの修正です。

test_has_many_through_has_one_with_has_many_through_source_reflection_preloadのテストがエラーになっていたのを対応しています。

単体でテストを動かした際、table_alias_lengthが設定されずエラーになってしまっていたようなので、テストの先頭でActiveRecord::Base.connection.table_alias_lengthを曜日出して、値を設定するようにしています。

table_alias_lengthについてはこちら参照。