2016/11/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- For PostgreSQL >= 9.4 use
pgcrypto'sgen_random_uuid()instead ofuuid-ossp's UUID generation function. - Raise ActiveRecord::RecordNotFound from collection
*_idssetters for unknown IDs with a better error message.
Use accept header instead of mangling request path.
Action Packの修正です。
ActiveSupport::IntegrationTestクラスのhttp request実行用のメソッド(get、patch等)のasオプションを指定した場合に、formatを変更していたのを、formatは変更せず、適切なHTTP_ACCEPT headerを設定するよう修正しています。
post "/anything", params: params, headers: headers, as: :json # 上記を実行した場合に、request pathが`/anything.json`になっていたのを、`/anything`のままになるよう変更
formatが変わる(=pathが変わる)とroutingによっては挙動が変わってしまう事がある為、formatは変わらないよう変更したようです。
[ci skip] Explain only :json is shipped by default.
actionpack/lib/action_dispatch/testing/integration.rbのdocの修正です。
ActiveSupport::IntegrationTestクラスのdocのChanging the request encodingの項に、Railsが提供しているencoderはJSONだけである旨説明を追加しています。
[ci skip] Add changelog entry for 86754a8f
actionpack/CHANGELOG.mdの修正です。
先のaccept headerの対応について、CHANGELOGにentryを追加しています。
Merge pull request #25395 from yawboakye/use_gen_random_uuid_from_pgcrypto_extension
Active Recordの修正です。
PostgreSQL adapterでuuid型を使用した場合に、uuidを生成するのにuuid_generate_v4関数を使用していたのを、PostgreSQL 9.4以上の場合はgen_random_uuid関数を使用するよう修正しています。
PostgreSQL 9.4からはgen_random_uuidを使用するのが推奨されるようになった(uuid-ossp moduleを使用するのが推奨されなくなった)為。
参考:[PATCH] pgcrypto: implement gen_random_uuid
[ci skip] MiniTest -> Minitest
railties/test/code_statistics_calculator_test.rbの修正です。
CodeStatisticsCalculatorのテストでMinitestが古い名前(MiniTest)のままになっている箇所があったのを修正しています。
Distribute connections to previously blocked threads when we're done
activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rbの修正です。
clear_reloadable_connectionsメソッドで行っていたconnectionの割り当て処理をwith_new_connections_blockedメソッドで行うようにしています。
with_new_connections_blockedの方が処理を行うのに適切な為、とコメントされているのですが、その理由がちょっとわからない…。
Merge pull request #26718 from domcleal/5-0-stable-ids-writer-exception
Active Recordの修正です。
Rails 5からcollection *_ids settersに不正なidを指定した場合、ActiveRecord::AssociationTypeMismatchがraiseされるようになっていたのを、Rails 4までの挙動に合わせてActiveRecord::RecordNotFoundをraiseするよう修正しています。
# before Class: <ActiveRecord::AssociationTypeMismatch> Message: <"Developer(#43811860) expected, got NilClass(#16732720)">
# after Class: <ActiveRecord::RecordNotFound> Message: <"Couldn't find all Developers with 'id': (1, -9999) [WHERE \"contracts\".\"company_id\" = ?] (found 1 results, but was looking for 2)">