なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2014/08/13)

2014/08/13分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activerecord/CHANGELOG.md


[ci skip] Updated where scope to conform to new style

activerecord/lib/active_record/associations.rbのdocの修正です。

サンプルのwhereメソッドの書き方を修正しています。

-      #   belongs_to :valid_coupon, ->(o) { where "discounts > #{o.payments_count}" },
+      #   belongs_to :valid_coupon, ->(o) { where "discounts > ?", o.payments_count },

index_exists? with :name checks specified columns.

activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rbの修正です。

index_exists?メソッドカラム名のチェックも行うよう修正しています。

# Before:
index_exists? :articles, :title, name: "idx_title" # => `true`
index_exists? :articles, :body, name: "idx_title" # => `true`

# After:
index_exists? :articles, :title, name: "idx_title" # => `true`
index_exists? :articles, :body, name: "idx_title" # => `false`

より正確にチェックされるようになったのですが、微妙に非互換なので、ちょっと注意が必要そうな。


[ci skip] fix spelling of override

各テストファイルの修正です。

overridenoverriddenに修正しています。typoの修正ですね。


AM, AP, AV, and AMo tests are already order_independent!

各テストファイルの修正です。

ActionMailerActionPackActionViewActiveModelについては、テストが実行順序に依存してない、との事なので、ActiveSupport::TestCase.my_tests_are_order_dependent!の呼び出しを削除しています。


Duplicated method in the test helper

activesupport/test/dependencies_test.rbの修正です。

重複しているメソッドを削除しています。


Reset ActiveSupport::Dependencies.mechanism to make tests order independent

activesupport/test/dependencies_test.rbの修正です。

実行順序に依存してしまっているテストがあったのを修正しています。

with_loadingというテスト用のヘルパーメソッドがあるのですが、それの呼び出しが足りて無かったようです。


AS tests are now order_independent!

activesupport/test/abstract_unit.rbの修正です。

上記対応に伴い、ActiveSupportもテストが実行順序に依存しなくなったので、ActiveSupport::TestCase.my_tests_are_order_dependent!を削除しています。


Fix Railties tests that were order dependent

railties/test/generators_test.rbの修正です。

Rails::Generators.fallbacksを削除する後処理が足りて無かったのを対応しています。


Railties tests are order_independent! Hopefully.

railties/test/abstract_unit.rbの修正です。

上記対応に伴い、Railtiesもテストが実行順序に依存しなくなったので、ActiveSupport::TestCase.my_tests_are_order_dependent!を削除しています。


[ci skip] correct default cache store class

actionpack/lib/action_controller/caching.rbのdocの修正です。

docのデフォルトのcache store classの説明を修正しています。FileStoreがデフォルト。


actionmailer_tests_are_order_dependent!

actionmailer/test/abstract_unit.rbの修正です。

ActionMailerのテストについては、まだテストが実行順に依存していらしく、ActiveSupport::TestCase.my_tests_are_order_dependent!を戻しています。


use :test delivery method for base_test.rb

actionmailer/test/abstract_unit.rbactionmailer/test/base_test.rbの修正です。

setupActionMailer::Base.delivery_methodにtestを指定するよう対応しています。

これで対応完了のようなので、再度ActiveSupport::TestCase.my_tests_are_order_dependent!を削除しています。