2014/09/09分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- introduce
connection.supports_views?
and basic view tests. - Allow included modules to override association methods.
Do not memoize document_root_element in view tests
actionview/lib/action_view/test_case.rb
の修正です。
クラス変数に格納していたhtml documentの情報を変数に保持しないよう修正しています。
最初にassert_select
呼び出した後にviewが変更した場合に、正しく値が取得出来ない問題が発生した為修正したようです。コミットログ見る限り、rails-dom-testing
の方の問題のような。
Add docs for web-console to 4.2 Upgrade Guide [ci skip]
rails guideのA Guide for Upgrading Ruby on Rails
の修正です。
web-consoleについての説明を追加しています。
基本的にはweb-console
のdocに書いてある内容を追加している感じです。application.rb
にconfig.web_console.automount = true
を設定する、という説明になっているんですが、developmentでしか使わないgemなので、application.rb
に定義するのは不味い気がしますねえ。
Remove extra 'has been' from the deprecation message
actionpack/lib/action_dispatch/testing/assertions/tag.rb
の修正です。
TagAssertions
に関するdeprecateメッセージに、"has been"が2回含まれてしまっていたので片方削除しています。
Remove extra 'has been' from deprecation warning about asserting selectors
actionpack/lib/action_dispatch/testing/assertions/selector.rb
の修正です。
同上。
Update upgrading guide about error handling in transactional callbacks
rails guideのA Guide for Upgrading Ruby on Rails
の修正です。
ActiveRecordのcallbacksでのエラーハンドリングの変更について追記しています。
rails guideのA Guide for Upgrading Ruby on Rails
の修正です。
上記修正の追加です。文中から、不要な"now"を削除しています。
Remove extra newline from ActiveJob test template
railties/lib/rails/generators/test_unit/job/templates/unit_test.rb.erb
の修正です。
変な所に改行があったので、削除しています。
[ci skip] change the line orientation on asset precompile page
rails guideのThe Asset Pipeline
の修正です。
ExecJSの説明の箇所について、改行の位置を調整しています。
Allow included modules to override association methods.
ActiveRecordの修正です。
includeしたmoduleでassociationのメソッドをオーバーライド出来るよう修正しています。
わかりずらかったので、テストから抜粋。
module MyModule def comments; :none end end class MyArticle < ActiveRecord::Base self.table_name = "articles" include MyModule has_many :comments, inverse_of: false end def test_included_module_overwrites_association_methods assert_equal :none, MyArticle.new.comments end
MyArticle.new.comments
は、本来associationのcomments
の筈なのですが、MyModule
をincludeしているので、MyModule
の方のcomments
メソッドが呼ばれている。
挙動的に少し違和感があるのですが、rails 4.0.x系では上記動作で動いていたとの事で、対応しています。
introduce connection.supports_views?
and basic view tests.
ActiveRecordのadapterの修正です。
adapterがviewに対応しているかどうかチェックする為の、connection.supports_views?
メソッドを追加しています。
現状、テストでだけ使われているようです。チェック処理みて気付いたのですが、MySQL 4系ってview、正式対応してなかったんですね。
add test-cases for primary-key-less-views. Closes #16555.
activerecord/test/cases/view_test.rb
の修正です。
primary keyが無いviewについてのテストを追加しています。
models backed by views don't assume "id" columns are the primary key.
activerecord/test/cases/view_test.rb
の修正です。
idカラムがprimary keyではない場合のテストを追加しています。
Oracle does not support IF EXISTS
for DROP VIEW
.
activerecord/test/cases/view_test.rb
の修正です。
SQLでIF EXISTS xxx
を使用していたのを、if @connection.table_exists?
を使用するよう修正しています。Oracle対応ですね。