2015/03/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Remove alias for i_suck_and_my_tests_are_order_dependent
.
activesupport/lib/active_support/test_case.rb
の修正です。
使用していないi_suck_and_my_tests_are_order_dependent!
のエイリアスのmy_tests_are_order_dependent
を削除しています。
randomにテストを実行したくない場合に設定する為の値だったのですが、後からtest_order=
が入り、そちらを設定するようになった為、こちらは不要の為削除しています。
Make sure Array#to_sentence always returns a String
activesupport/lib/active_support/core_ext/array/conversions.rb
の修正です。
Array#to_sentence
メソッドが必ずStringクラスを返すよう修正しています。
# before [ActiveSupport::SafeBuffer.new("foo")].to_sentence.class # => ActiveSupport::SafeBuffer [ActiveSupport::SafeBuffer.new("foo"), "bar"].to_sentence.class # => String # after [ActiveSupport::SafeBuffer.new("foo")].to_sentence.class # => String [ActiveSupport::SafeBuffer.new("foo"), "bar"].to_sentence.class # => String
html_safe
のバリデーションする/しない等の差異が出てしまう為、統一されるようにしたとの事です。
Pass wrapped class name to Sidekiq for logging purposes
activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb
の修正です。
Sidekiq::Client.push
メソッドの引数のwrapped
にクラス名を渡すよう修正しています。
Sidekiq::Client.push \ - 'class' => JobWrapper, - 'queue' => job.queue_name, - 'args' => [ job.serialize ] + 'class' => JobWrapper, + 'wrapped' => job.class.to_s, + 'queue' => job.queue_name, + 'args' => [ job.serialize ]
sidekiqのログにクラス名が表示されるようにする為との事。
activesupport/lib/active_support/testing/time_helpers.rb
のdocの修正です。
TimeHelpers
moduleの説明のグラマーの修正を行っています。
[ci skip] Remove unacceptable method name
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
のdocの修正です。
remove_reference
のdocにreferenceを削除する為のメソッドの一覧が表示されているのですが、そこに存在しないメソッド(remove_references
)が記載されていたのを削除しています。
Fix incorrect description for assert_nothing_raised
.
activesupport/lib/active_support/test_case.rb
のdocの修正です。
assert_nothing_raised
メソッドの説明に誤りがあった(何も例外が起こらなかった場合にエラーになるメソッドなのに、例外が起きた際にエラーになる、となっていた)のを修正しています。
Merge pull request #19493 from larskanis/add_infinity_test
activerecord/test/cases/adapters/postgresql/infinity_test.rb
の修正です。
"Infinity" 文字列をfloat型のカラムに設定した場合のテストを追加しています。
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
has_many through associationを設定しているクラスをjoinし、カルキュレーション系のメソッド(count
など)を呼び出した際に、
実際のテーブル名ではなく、through joinの際にエイリアスが使用されてしまい、エラーになってしまうバグがあったのを修正しています。
class Shop < ActiveRecord::Base has_many :categories has_many :products, through: :categories end class Category < ActiveRecord::Base belongs_to :shop belongs_to :reseller has_many :products end class Product < ActiveRecord::Base belongs_to :category end class Reseller < ActiveRecord::Base has_many :categories end shop = Shop.first shop.products.includes(category: :reseller).where(resellers: { id: 1 }).count
# Rails 4.0.x SELECT COUNT(DISTINCT `products`.`id`) FROM `products` LEFT OUTER JOIN `categories` `categories_products` ON `categories_products`.`id` = `products`.`category_id` LEFT OUTER JOIN `resellers` ON `resellers`.`id` = `categories_products`.`reseller_id` INNER JOIN `categories` ON `products`.`category_id` = `categories`.`id` WHERE `categories`.`shop_id` = 1 AND `resellers`.`id` = 1
# Rails 4.1.x, 4.2.x SELECT COUNT(DISTINCT `products`.`id`) FROM `products` LEFT OUTER JOIN `categories` `categories_products` ON `categories_products`.`id` = `products`.`category_id` LEFT OUTER JOIN `resellers` ON `resellers`.`id` = `categories`.`reseller_id` INNER JOIN `categories` ON `products`.`category_id` = `categories`.`id` WHERE `categories`.`shop_id` = 1 AND `resellers`.`id` = 1