なるようになるブログ

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

rails commit log流し読み(2020/11/10)

2020/11/10分のコミットです。

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

activerecord/CHANGELOG.md

railties/CHANGELOG.md


Clean up preventing writes tests

Active Recordのテストの修正です。

preventing writeのテストから、不要なtransactionやassert_deprecated等の呼び出し等を削除しています。


Allow constructors for has_one :through

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

has_one :through associationの構築が出来るよう修正しています。


Merge pull request #40570 from tahsin352/th_remove_jquery_metadata

使用していないjQuery metadataを削除しています。


Merge pull request #40008 from santib/upgrading-to-image-processing

rails guideのUpgrading Ruby on Railsの修正です。

Upgrading from Rails 6.0 to Rails 6.1の項に、Active Storageを利用するにはImage Processingが必要になっている旨説明した、Active Storage now requires Image Processingを追加しています。


Always show version badge, not just for edge [ci skip]

rails guideの修正です。

rails guideで、edge以外の場合もバージョンバッジを表示するよう修正しています。


Support delegators in query Predicate building

activerecord/lib/active_record/relation/predicate_builder.rbactiverecord/lib/active_record/relation/predicate_builder/association_query_value.rbの修正です。

predicate conditionsを構築する際に、値がActiveRecord::Baseを継承したインスタンスかどうかでチェックしていたのを、respond_to?でidを取得出来るかどうかに修正しています。

predicate conditionsにdelegateしたオブジェクトを渡せるようにする為。


Don't require event to be passed to read_entry

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

read_entryメソッドで、intrumentation payload用のstoreを設定する際に、eventオプションが指定されている場合のみ設定するよう修正しています。eventオプションが指定されていないstoreが使用された場合に、エラーにならないようにする為。


Allow access to CurrentAttributes in test teardown

activesupport/lib/active_support/current_attributes/test_helper.rbの修正です。

currentattributesのリセット処理をbefore_teardownで行っていたのを、after_teardownで行うよう修正しています。テストで定義したteardownでcurrentattributes`の値を参照出来るようにする為。


Upgrade sdoc to 2.0.2

Gemfile.lockの修正です。

sdocのバージョンを2.0.2に更新しています。


Update active storage s3 direct uploads docs

rails guideのActive Storage Overviewの修正です。

S3のCORS configurationのexampleが古いフォーマット(XML)だったのを、最新のフォーマット(JSON)に修正しています。


Add missing TLD to api links in AR queries guide [skip ci]

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

API docへのリンクにTLDの指定が不足していたのを修正しています。


Display exception messages using simple_format for a better and clearer

actionpack/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erbの修正です。

デフォルトのエラーページでExceptionを表示する際に、simple_formatメソッドを使用して見た目を調整するよう修正しています。


Document ActionController::Cookies#cookies [ci-skip]

actionpack/lib/action_controller/metal/cookies.rbのdocの修正です。

ActionController::Cookies#cookiesメソッドにdocを追加しています。


Merge pull request #40577 from jonathanhefner/guide-layouts_and_rendering-link-api

rails guideのLayouts and Rendering in Railsの修正です。

各メソッドについてAPI docにリンクするよう修正しています。


Append development routes after reload hook

railties/lib/rails/application/finisher.rbの修正です。

root routeを独自に追加している場合に、Rails内部で使用しているroutesもそのroot route配下に定義されるよう修正しています。


[ci skip] Fix outdated class in multiple database docs.

rails guideのMultiple Databases with Active Recordの修正です。

connected_toroleに存在しない値を指定した場合のエラーメッセージが、実際に出力される内容と異なっていたのを修正しています。


Allow subscribing with a single argument callable

activesupport/lib/active_support/notifications/fanout.rbの修正です。

ActiveSupport::Notifications.subscribeの引数にcallableオブジェクトを指定した場合に、下記のようにそのcallableオブジェクトで引数にEventObjectを受ける事が出来なかったのを修正しています。

listener = ->(event) do
  puts "Reacting to #{event.name}"
end

ActiveSupport::Notifications.subscribe('some_event', &listener)