2015/12/07分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Merge pull request #22480 from keepcosmos/add-translate-test
activemodel/test/cases/translation_test.rb
の修正です。
namespace付きmodelをtranslateした場合のテストを追加しています。
[ci skip] Add a dollar sign to each command in the READMEs
各READMEの修正です。
コンソールでコマンドを実行するexampleを記載している箇所で、コンソールを表すのにシャープを使用している箇所があったのを、他の箇所同様ドルマークを使用するよう修正しています。
- % gem install actionpack + $ gem install actionpack
Merge pull request #22453 from wjessop/use_action_dispatch_default_tld_length
actionpack/test/dispatch/request_test.rb
の修正です。
request処理のテストでtld_length
のデフォルトの値を1に固定していたのを、実際の値(ActionDispatch::Http::URL.tld_length
)を使用するよう修正しています。
Merge pull request #22428 from thedarkone/subs-notif
activesupport/lib/active_support/notifications/fanout.rb
、
activesupport/lib/active_support/notifications/instrumenter.rb
の修正です。
ActiveSupport::Notifications.instrument
メソッドの内でActiveSupport::Notifications.subscribe
メソッドを呼び出した際に、時折エラーにバグがあったのを修正しています。
ActiveSupport::Notifications.instrument('foo') do ActiveSupport::Notifications.subscribe('foo') {} end
stateの管理が正しく行えてなかったのが問題だったようです。こんな使い方するんですねえ。
Introduce after{create,update,delete}commit callbacks
activerecord/lib/active_record/transactions.rb
の修正です。
after{create,update,delete}commit callbacksを追加しています。
名前の通りで、それぞれのタイミングのafter_commit
で行う処理を定義する為のメソッドです。このメソッドを使う事で、元々after_commit
メソッドのon
オプションでタイミングを定義していたのが不要になります。
# Before: after_commit :add_to_index_later, on: :create after_commit :update_in_index_later, on: :update after_commit :remove_from_index_later, on: :destroy # After: after_create_commit :add_to_index_later after_update_commit :update_in_index_later after_destroy_commit :remove_from_index_later
Push before_sending
to super class
Action Packの修正です。
Live::Response#before_sending
メソッドの処理を、親クラスであるResponse#before_sending
メソッドに移動しています。
Live::Response
クラスとResponse
クラスを統合する予定があり、その対応の一環のようです。
合わせて、空のrequest classを作成する為のActionDispatch::Request.empty
メソッドを追加しています。これは各テストコードで空のrequest classを作成する処理がハードコードされており、それを避ける為。
Stop violating law of demeter in response cookie_jar
actionpack/lib/action_dispatch/http/request.rb
、
actionpack/lib/action_dispatch/http/response.rb
、
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
Response#before_sending
メソッドで直接cookie_jarの#commit!
メソッドを呼び出していたのを、新規に#commit_cookie_jar!
メソッドを追加し、そちら経由で処理を行うよう修正しています。
Only commit the cookie jar if it hasn't been committed
actionpack/lib/action_dispatch/http/response.rb
の修正です。
#before_sending
メソッドでcookie jarをコミットする際、コミット済みかどうかを確認し、未コミットの場合のみコミット処理を行うよう修正しています。
Make sure we touch all the parents when touch_later.
Acitive Recordの修正です。
touch_later
実行時に、全ての親クラスをtouchするよう修正しています。
複数レコードに対するtouch
処理が一度だけ行われるよう修正した対応(Batch touch parent records](https://github.com/rails/rails/pull/19324))の影響で、曽祖父に対するtouch処理が動かなくなる、というバグが発生してしまい、その対応として修正しています。
activerecord/lib/active_record/callbacks.rb
のdocの修正です。
dependent: :destroy
をdependent: destroy
にタイポしていたのを修正しています。