なるようになるブログ

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

rails commit log流し読み(2019/02/14)

2019/02/14分のコミットです。

CHANGELOGへの追加はありませんでした。


Merge pull request #35244 from palkan/fix/activerecord-database-uri-resolve

activerecord/lib/active_record/database_configurations.rbの修正です。

DATABASE_URLを指定している、かつ、database.ymlDATABASE_URLを使用していない場合に、configパース時にエラーになってしまうバグがあったのを修正しています。


Merge pull request #35229 from rails/fix-35222

Action Viewの修正です。

formatsを指定してpartial template renderした際に、lookup contextが変わる(元々htmlが指定されていたのが、partial render時にformats: :xmlを指定した場合、以降xmlのtemplateがlookupされる)ようになっていたのを、partial renderでcontextは変わらなくなるよう修正しています。


Clean for fix done in #35229. Removed unused arguments

actionview/lib/action_view/base.rbの修正です。

ActionView:Baes.build_lookup_contextメソッドの引数から不要な変数を削除しています。


Address to useless assignment formats = nil after #35254

actionview/lib/action_view/base.rbの修正です。

Useless assignment to variable - formatsのワーニングが出ていたのを修正しています。


Refactors a loop

activesupport/lib/active_support/dependencies/zeitwerk_integration.rbの修正です。

ZeitwerkIntegration.setup_autoloadersメソッド内のautoload pathがディレクトリかどうかのチェック処理をearly returnを使用するようリファクタリングしています。


Cached collections only work if there is one template

actionview/lib/action_view/renderer/partial_renderer.rbの修正です。

cached collectionsにtemplateが2つ以上、又は未指定の場合に、エラーをraiseするよう修正しています。cached collectionsはtemplateが1つの場合のみ動作するため。


Revert "Chaining named scope is no longer leaking to class level querying methods"

Chaining name scopeを使用しているときそのchainしてるscopeがclass levelのquery methodに影響を与えないよう修正した、Chaining named scope is no longer leaking to class level querying methodsをRevertしています。

breaking changeになってしまうので、deprecateからはじめるとの事です。


Adding enque time tracking and logging

activejob/lib/active_job/core.rbactivejob/lib/active_job/logging.rbの修正です。

jobでenqueueした時間(enqueued_at)を保持するよう修正しています。


Use Dir#children and Dir#each_child instead of excluding "." and ".."

activesupport/lib/active_support/cache/file_store.rbの修正です。

Cache::FileStoreディレクトリの中身を取得する際に、...を自分で除外していたのを、Dir#childrenDir#each_childメソッドを使用するよう修正しています。


Add test for csp_meta_tag

actionview/test/template/csp_helper_test.rbの修正です。

csp_meta_tagメソッドについてのテストを追加しています。


Merge pull request #35261 from rails/zeitwerk-as-dependency

Active Supportの修正です。

先日サポートを行われたzeitwerkをActive Supportのdependencyに追加しています。

元々は使用するにはユーザが明示的にGemfileにzeitwerkを追加する必要があったのですが、Rails 6.0だとデフォルトで使用するようになっておりdependencyにしてしまって良いのでは、という話になり修正されました。


Register new autoloading in AS CHANGELOG [ci skip]

activesupport/CHANGELOG.mdの修正です。

zeitwerkの対応についてCHANGELOGにエントリーを追加しています。