2017/02/13分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Make
table_name=
reset current statement cache, so queries are not run against the previous table name. - Deprecate
supports_primary_key?
on connection adapters since it’s been long unused and unsupported. - PostgreSQL: schema dumping support for interval and OID columns.
- Deprecate passing
default
toindex_name_exists?
. - [Omit redundant
using: :btree
for schema dumping.]https://github.com/rails/rails/commit/6d37cd918dba5b492194afbc1094a6503c88f379)
Removed the attribute_accessors
required file:
actionpack/lib/action_dispatch/http/mime_type.rb
の修正です。
使用していないactive_support/core_ext/module/attribute_accessors
のrequireを削除しています。
Also not needed on this file, call to mattr_accessor
got removed in https://github.com/rails/rails/commit/9e98f3f7e61dfce0a48948c8d296400af8bfaf21#diff-1ecd313ff0ab827af30014553cf8918dL76
activesupport/lib/active_support/callbacks.rb
の修正です。
使用していないactive_support/core_ext/module/attribute_accessors
のrequireを削除しています。
Make table_name=
reset current statement cache
activerecord/lib/active_record/model_schema.rb
の修正です。
table_name=
メソッドを呼び出した際に、statement cacheをリセットするよう修正しています。statement cacheがそのままだと、tableを変更したのに古いテーブルに対してqueryが実行されてしまう事があった為。
各ファイルから使用していないactive_support/core_ext/string/strip
のrequireを削除しています。
Deprecate supports_primary_key?
Active Recordの修正です。
supports_primary_key?
メソッドをdeprecateにしています。
supports_primary_key?
メソッドは名前の通りadapterがprimary keyをサポートしているかどうかチェックするためのメソッドなのですが、既にこのチェック無しにprimary keyを使用していまっている、かつ、全てのadapterでprimary keyはサポートしており、チェックする必要が無い、という事でdeprecateになったようです。
Schema dumping support for PostgreSQL interval type
Active Recordの修正です。
schema dump処理にPostgreSQL interval typeの対応を追加しています。
Schema dumping support for PostgreSQL oid type
schema dump処理にPostgreSQL oid typeの対応を追加しています。
The default
arg of index_name_exists?
makes to optional
Active Recordの修正です。
index_name_exists?
メソッドのdefault
引数をオプショナル引数に変更しています。
default
引数はadapterがindexをサポートしてない場合にのみ使用する引数なのですが、現状全てのadapterがindexをサポートしており、使用されていない変数の為、渡さないでよいようにする為にオプショナル引数に変更したようです。で、そもそも使用されてないので、後ほどdeprecateにになっています。
Merge pull request #26630 from kamipo/quoted_binary
Active Recordの修正です。
biynaryのquote処理をメソッド(quoted_binary
)に切り出して、そちらを使用するよう修正しています。
Deprecate passing default
to index_name_exists?
Active Recordの修正です。
index_name_exists?
メソッドのdefault
引数がdeprecateになっています。理由は先ほど書いたとおり。
Merge pull request #27122 from kamipo/fix_unscope_with_subquery
activerecord/lib/active_record/relation/where_clause.rb
の修正です。
subqueryをunscope出来ないバグがあったのを修正しています。
Refactor test_find_by_does_not_use_statement_cache_if_table_name_is_changed
activerecord/test/cases/statement_cache_test.rb
の修正です。
table_name=
メソッドを呼び出した際にstatement cacheをリセットされる事を確認するテストで、レコードの再取得をする際に既に作成済みのインスタンスの値を使用するよう修正しています。
Omit redundant using: :btree
for schema dumping
activerecord/lib/active_record/schema_dumper.rb
の修正です。
indexにbtreeを使用している場合に、schemaファイルにusing: :btree
オプションを出力しないよう修正しています。デフォルトでindexはbtree
として扱われる為、明示的に指定する必要は無いから、ですかねえ。