2016/09/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Add #25546 and #25817 to changelog [ci skip]
actionpack/CHANGELOG.md
の修正です。
#fresh_when
、#stale?
でEtagを生成する際、template
オプションにfalseが指定されていた場合Etagにtemplate digestの値を含まないよう修正した対応(Fix adding implicitly rendered template digests to ETags)、及び、ETag用のtemplate digestを作成する際に、controlerのnamespaceが考慮されないバグがあったのを考慮されるよう修正した対応(Fix adding implicitly rendered namespaced template digests to ETags)について、CHANGELOGにentryを追加しています。
Merge pull request #26563 from knugie/fix_issue_26430
activesupport/lib/active_support/core_ext/load_error.rb
の修正です。
active_support/deprecation
のrequireが不足していたので追加しています。
Serialize JSON attribute value nil as SQL NULL, not JSON 'null'
activerecord/lib/active_record/type/internal/abstract_json.rb
の修正です。
JSON typeを使用していた場合に、valueがnilだった場合にJSONの"null"(ただの"null"という文字列)として値が扱われていたのを、SQLのNULL
として扱うよう修正しています。
Fix docs for allowed params to get
in controller tests [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
Functional Tests for Your Controllers
の項にあるexampleコードでget
メソッドの引数にアクション名を指定していたのを、URLを指定するよう修正しています。
-get :show, params: { id: 12 }, headers: { "HTTP_REFERER" => "http://example.com/home" } +get article_url, params: { id: 12 }, headers: { "HTTP_REFERER" => "http://example.com/home" }
テストの親クラスにActionController::TestCase
クラスを使用している場合はアクション名を指定出来るのですが、Rails 5.0ではcontroller testの親クラスにActionDispatch::IntegrationTest
を使用するようになり、アクション名を指定しての処理は行えない為。
Only search fixture_path for files that can't be found directly
actionpack/lib/action_dispatch/testing/test_process.rb
の修正です。
fixture_file_upload
メソッドでfixture_path
とpath
の連結を行う際に、path
にファイルが存在しない場合のみ連結処理を行うよう修正しています。
def fixture_file_upload(path, mime_type = nil, binary = false) - if self.class.respond_to?(:fixture_path) && self.class.fixture_path + if self.class.respond_to?(:fixture_path) && self.class.fixture_path && + !File.exist?(path) path = File.join(self.class.fixture_path, path) end
path
に絶対パスを指定された場合に、不要なfixture_path
が連結されてしまうのを防ぐ為、との事です。
switch to autorun to support after_run and patch less
railties/lib/rails/commands/test.rb
の修正です。
test runnerで、Minitest.run
を直接呼び出してテストを実行していたのを、minitest/autorun
をrequireしてテストを実行するよう修正しています。
-exit Minitest.run(ARGV) +require "minitest/autorun"
Minitest.after_run
hookが実行されるようにする為、との事です。
Fix ActiveSupport::TimeWithZone#in
activesupport/lib/active_support/time_with_zone.rb
の修正です。
ActiveSupport::TimeWithZone#in
がサマータイム考慮した値を返していなかったのを、サマータイムを考慮した正しい値を返すよう修正しています。
# before Time.zone = "US/Eastern" t = Time.zone.local(2016,11,6,1) # => Sun, 06 Nov 2016 01:00:00 EDT -04:00 t.in(1.hour) # => Sun, 06 Nov 2016 02:00:00 EST -05:00
# after Time.zone = "US/Eastern" t = Time.zone.local(2016,11,6,1) # => Sun, 06 Nov 2016 01:00:00 EDT -04:00 t.in(1.hour) # => Sun, 06 Nov 2016 01:00:00 EST -05:00