2014/09/11分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- MySQL: correct LONGTEXT and LONGBLOB limits from 2GB to their true 4GB
- MySQL: schema.rb now includes TEXT and BLOB column limits.
- A
NullRelation
should represent nothing. Closes #15176.
i18n guide: clarify interpolation rules in _html keys [ci skip]
rails guideのRails Internationalization (I18n)
の修正です。
ymlに組み込みの値設定するやり方についてのサンプルを追加しています。
en: welcome_html: "<b>Welcome %{username}!</b>"
you can safely pass the username as set by the user:
<%# This is safe, it is going to be escaped if needed. %> <%= t('welcome_html', username: @current_user.username %>
Replace drop sql statement to drop_table method
ActiveRecordのテストの修正です。
tableをdropする際、SQLで行っていたのをdrop_table
メソッドを使用するよう修正しています。
Merge pull request #16867 from yahonda/use_drop_table_to_drop_sequences
Merge pull request #16379 from JackDanger/update-preloader-documentation
activerecord/lib/active_record/associations/preloader.rb
のdocの修正です。
Associations
の説明が大分古いままになっており、現在の仕様に合わせた内容に修正しています。
ActiveJobのIntegrationテストを追加しています。 redis等の外部システムとの連携もあるので、中々大変そうな感じです…。
MySQL: correct LONGTEXT and LONGBLOB limits from 2GB to their true 4GB
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
の修正です。
MySQLのLONGTEXT、LONGBLOB型のlimitを2GB->4GBに修正しています。
MySQLのdocを見る限り、どちらも最長4GBとなっているので、単純に間違えていたようですね。
MySQL: schema.rb now includes TEXT and BLOB column limits.
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
の修正です。
MySQLのTEXT、BLOBカラムについても、limitを設定するよう対応しています。 どちらも65535です。こちらもMySQLのdocにちゃんと記載ありますね。
Include default column limits in schema.rb https://github.com/rails/rails/commit/2c76793f087e212ff4c6d835656a9a95c8bfeaa5
activerecord/test/cases/schema_dumper_test.rb
の修正です。
schemaのダンプ処理は、最初のテストのみ行い以降はその値を使いますよう修正しています。
テスト高速化の為ですね。ただ、テスト実行順に依存しちゃいそうな。
Merge pull request #16839 from chancancode/default_test_order
テストの実行順を設定する為のオプションとして、active_support.test_order
が追加されました。
# config/environments/test.rb Rails.application.configure do config.active_support.test_order = :sorted end
4.2ではデフォルトがsorted
となっており、5系ではrandom
に変わる予定との事です。minitestの変更を受けて、ですかね。
rails guideのA Guide for Upgrading Ruby on Rails
の修正です。
locking
をlock
に修正しています。typo。
Set the test order to be random in the generated app
railties/test/isolation/abstract_unit.rb
の修正です。
generateするappにconfig.active_support.test_order = :random
を設定するよう修正しています。
Set test order in ActiveSupport::TestCase of isolation/abstract_unit
railties/test/isolation/abstract_unit.rb
の修正です。
self.test_order = :sorted
を設定しています。
Define the configuration at Active Support
ActiveSupportの修正です、
test_order
の値をActiveSupport
クラスで保持するよう修正しています。
Always define capture to remove the deprecation message
railties/test/abstract_unit.rb
の修正です。
unless defined?(:capture)
を削除しています。
元々のcapture
メソッドはdeprecate対象の為、使おうとすると毎度warningが出力されてしまうので、それを避ける為に、強制的にメソッド再定義するよう対応したようです。
A NullRelation
should represent nothing. Closes #15176.
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
NullRelation
が必ず空の値を返すよう修正しています。
PRから抜粋。
# before Parent.listings.where(id: Listing.none).count => all_record_count # after : Parent.listings.where(id: Listing.none).count => 0
確かに、none
を使用しているのに、値が返ってくるのは、想定外な感じの気がします。
switch assert_operator
arguments as discussed in #16860.
activerecord/test/cases/relations_test.rb
の修正です。
assert_operator
メソッドの引数の順番が誤っていたのを修正しています。
rails guideのThe Asset Pipeline
の修正です。
サンプルでputs
メソッドを使用していたのをlogger.info
を使用するよう修正しています。
reuse view test-cases for pg materialized view tests.
activerecord/test/cases/adapters/postgresql/view_test.rb
の修正です。
materialized viewのテストで、一度作成したviewを使いまわすよう修正しています。
"materialized view"というのを知らなかったのですが、集約や集計系の処理をする際に使われる機能で、ビューから取得できるデータの実体を持つ(materialized)ビューの事何ですね。
ビューから取得できるデータを実体として保持しておく事が出来るらしいので、ビューへの問い合わせが高速出来るらしいです。詳しくはこちらの記事ご参考。
pg, add test cases for updateable views.
activerecord/test/cases/adapters/postgresql/view_test.rb
の修正です。
updateable viewsについてのテストを追加しています。