2017/02/27分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Deprecate
supports_migrations?on connection adapters. - Use
max_identifier_lengthforindex_name_lengthin PostgreSQL adapter
activerecord/test/cases/connection_pool_test.rbの修正です。
一つのテストでまとめて行われていた、disconnectの後に自動で再接続が行われる事を確認するテストと、automatic_reconnectにfalseを指定した場合のテストを、別のテストに分けています。
Deprecate supports_migrations? on connection adapters
Active Recordの修正です。
connection adapterのsupports_migrations?メソッドがdeprecateになりました。
supports_migrations?メソッドは名前の通りcreate_tableやdrop_table等のmigration系のメソッドが使用出来るかどうか確認する為のメソッドなのですが、現状サポートしているadapterは全てmigrationメソッドをサポートしており、そもそもチェックする必要が無くなっている為、deprecateにしたとの事です。
Update i18n guide to cover :zero key support in pluralization [ci skip]
rails guideのRails Internationalization (I18n) APIの修正です。
Pluralizationの項に、translationsの:zero keyについての説明を追加しています。
Use max_identifier_length for index_name_length in PostgreSQL adapter
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb、
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rbの修正です。
PostgreSQL adapterのindex nameが63固定になっていたのを、max_identifier_length パラメータの値を使用するよう修正しています。
Fix test_apply_distinct_in_count failure in PG adapter
activerecord/test/cases/calculations_test.rbの修正です。
distinct + countを組み合わせた場合のテストがPostgreSQL adapterでfailしていたのを修正しています。
queries.each do |query| + # `table_alias_length` in `column_alias_for` would execute + # "SHOW max_identifier_length" statement in PostgreSQL adapter. + next if query == "SHOW max_identifier_length" assert_match %r{\ASELECT(?! DISTINCT) COUNT\(DISTINCT\b}, query end
先のmax_identifier_lengthを使用する対応の影響によるものです。
Merge pull request #25274 from kamipo/fix_find_nth_with_limit_value
activerecord/lib/active_record/relation/finder_methods.rbの修正です。
limitに指定された範囲外のfinderメソッドを使用した場合(e.g. Topic.limit(1).second)にDBにqueryを投げずに空の値を返すよう修正しています。
Only load SystemTestCase if Puma is defined
railties/lib/rails/test_help.rbの修正です。
SystemTestCaseクラスのload処理を、Capbyara及びPuma両方が定義されている場合にのみ行うよう修正しています。
SystemTestCaseクラスは現状Pumaのみをサポートしており、Pumaが定義されてないとエラーになってしまう為。
Set correct host except development environment
railties/lib/rails/commands/server/server_command.rbの修正です。
rails serverのHostオプションのデフォルトに全ての環境でlocalhostが使われていたのを、Rails 5.0までと同様に、developmentでのみlocalhostを使用し、それ以外の環境では0.0.0.0を使用するよう修正しています。
activerecord/test/support/connection.rbの修正です。
$ARCONNに存在しないconnectionを指定した場合に、指定可能なconnectionの一覧を表示するよう修正しています。
PRより。
Before
$ ARCONN=postgres bundle exec ruby -Itest test/cases/adapters/postgresql/connection_test.rb
Using postgres
/Users/kir/Projects/opensource/rails/activerecord/lib/active_record/connection_handling.rb:63:in `dup': can't dup NilClass (TypeError)
from /Users/kir/Projects/opensource/rails/activerecord/lib/active_record/connection_handling.rb:63:in `initialize'
from /Users/kir/Projects/opensource/rails/activerecord/lib/active_record/core.rb:46:in `new'
from /Users/kir/Projects/opensource/rails/activerecord/lib/active_record/core.rb:46:in `configurations='
from /Users/kir/Projects/opensource/rails/activerecord/test/support/connection.rb:19:in `connect'
from /Users/kir/Projects/opensource/rails/activerecord/test/cases/helper.rb:24:in `<top (required)>'
from test/cases/adapters/postgresql/connection_test.rb:1:in `require'
from test/cases/adapters/postgresql/connection_test.rb:1:in `<main>'
After
$ ARCONN=postgres bundle exec ruby -Itest test/cases/adapters/postgresql/connection_test.rb Using postgres Connection "postgres" not found. Available connections: jdbcderby, jdbch2, jdbchsqldb, jdbcmysql, jdbcpostgresql, jdbcsqlite3, db2, mysql, mysql2, oracle, postgresql, sqlite3, sqlite3_mem