なるようになるブログ

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

rails commit log流し読み(2018/07/31)

2018/07/31分のコミットです。

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

actionpack/CHANGELOG.md


cpu_time and allocations are 0 when JRuby is used

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

ActiveSupport::Notifications::Eventcpu_timeallocationsJRubyの場合0を返すことを確認するテストを追加しています。


Ignore concurrently-deleted files when deleting by prefix from GCS

activestorage/lib/active_storage/service/gcs_service.rbの修正です。

ActiveStorage::Service::GCSService#delete_prefixedメソッドでファイルを削除する際に、Google::Cloud::NotFoundErrorが発生してもエラーを無視するよう修正しています。

同時にファイルが削除された場合等にNotFoundErrorが発生する可能性がある為。


A regression in deprecate_methods was introduced in a982a42:

activesupport/lib/active_support/deprecation/method_wrappers.rbの修正です。

Moduleのクラスメソッドに対して、deprecate_methodsが動作しないバグがあったのを修正しています。


Avoid extra scoping when using Relation#update

class levelのupdateをidを指定せずに実行した、かつ、scopeを指定していた場合に、そのscopeの影響を受けてしまい、正しく更新処理が行われないバグがあったのを修正しています。


Remove unused require

activesupport/lib/active_support/deprecation/method_wrappers.rbの修正です。

使用していないactive_support/core_ext/module/aliasingのrequireを削除しています。


Guard against missing blobs caused by concurrent purges

activestorage/app/models/active_storage/attachment.rbの修正です。

blobのpurge処理を呼び出す際にSafe Navigation Operatorを使用するよう修正しています。

purgeをコンカレントに行った場合に、blobがpurge済み(nil)になっている可能性がある為。


All links from README.md now served over https

README.mdの修正です。

外部ページへのリンクをまとめてhttpsに修正しています。


[ci skip] Fix the outdated description for find_each.

rails guideのActive Record Query Interfaceの修正です。

Options for find_eachの項、:startオプションについて説明している箇所で、primary keyはintegerでなければならない旨記載されていたのですが、実際はintegerでなくても問題無い為、該当の部分を削除しています。


Fix example in thread_mattr_accessor documentation

activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rbのdocの修正です。

thread_mattr_accessorメソッドのdoc内のexampleでmattr_accessorを使用していたのを、thread_mattr_accessorを使用するよう修正しています。


Merge pull request #33446 from ptoomey3/nested-respond-to

actionpack/lib/action_controller/metal/exceptions.rbactionpack/lib/action_controller/metal/mime_responds.rbの修正です。

respond_toをネストして使用している、かつ、ネストした先と呼び出し元でtypeの指定が一致していない場合に、ActionController::RespondToMismatchErrorをraiseするよう修正しています。

例。

respond_to do |outer_type|
  outer_type.js do
    respond_to do |inner_type|
      inner_type.html { render body: "HTML" }
    end
  end
end

上記のように、呼び出し元のtypeがjsなのに、中ではhtml typeに関する処理を定義している、というような場合にExceptionをraiseするようになっています。


:scissors: .

actionpack/CHANGELOG.mdの修正です。

先のrespond_toの対応のエントリーから不要なドットを削除しています。