2015/05/01分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activejob/CHANGELOG.md
Merge pull request #19969 from y-yagi/fix_job_helper_method
activejob/lib/active_job/test_helper.rb
の修正です。
assert_enqueued_jobs
、assert_performed_jobs
メソッドで、メソッドの引数に指定した期待値と。実際の結果の値が異なる場合に出力されるエラーメッセージ内の、Expected
の値に誤りがあったのを修正しています。
例。
test "sample1" do GuestsCleanupJob.perform_later('guest 1') assert_enqueued_jobs 2 do GuestsCleanupJob.perform_later('guest 2') end end
# before 1) Failure: GuestsCleanupJobTest#test_test_1 [/home/yaginuma/program/rails/master/test/jobs/guests_cleanup_job_test.rb:6]: 2 jobs expected, but 1 were enqueued. Expected: 3 Actual: 2 # after 1) Failure: GuestsCleanupJobTest#test_test_1 [/home/yaginuma/program/rails/master/test/jobs/guests_cleanup_job_test.rb:6]: 2 jobs expected, but 1 were enqueued. Expected: 2 Actual: 1
Merge pull request #19844 from stevenspiel/link_to_if_block_helper_addition
actionview/lib/action_view/helpers/url_helper.rb
の修正です。
link_to_if
メソッドの引数に指定したblockを、そのままlink_to
メソッドに渡すよう修正しています。
が、link_to_if
メソッドに渡すblockは、conditionがfalse
だった場合に実行する処理を指定する為のもので、link_to
メソッドに渡す為のモノではないという事で、直後にrevertしています。
<%= link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user }) end %> # ユーザがログインしてない場合 # => <a href="/sessions/new/">Login</a> # ユーザがログイン済みの場合 # => <a href="/accounts/show/3">my_username</a>
なるほどー。
Revert "Merge pull request #19844 from stevenspiel/link_to_if_block_helper_addition"
という訳で、直前のlink_to_if
メソッドの対応をrevertしています。
add test-case for link_to_if
behavior with a block.
actionview/test/template/url_helper_test.rb
の修正です。
link_to_if
、link_to_unless
メソッドの引数にブロックを指定した場合のテストを追加しています。
Update documentation to contain a 24 char token [ci skip]
activerecord/lib/active_record/secure_token.rb
のdocの修正です。
has_secure_token
メソッドのdocにあるtoken
メソッドの実行結果を、実際の実行結果と同じ桁数になるよう修正しています。
Improvement on Activerecord CHANGELOG
activerecord/CHANGELOG.md
の修正です。
シングルクォートで囲まれていたActiveRecord::Type::Numeric
をバッククォートで囲むよう修正しています。