なるようになるブログ

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

rails commit log流し読み(2019/09/17)

2019/09/17分のコミットです。

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


Merge pull request #37120 from gmcgibbon/fix_has_one_reflect_check_custom_pk

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

has_one through relation + integerじゃないprimary keyを使用していた場合に、エラーになってしまうバグがあったのを修正しています。


Docs: note removal of render :text option from 5.1 guide [ci skip]

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

Upgrading from Rails 5.0 to Rails 5.1の項にrendertextオプションが削除された対応についての説明を追加しています。


Reduce Array and Hash creations in Journey find_routes

actionpack/lib/action_dispatch/journey/router.rbの修正です。

find_routesメソッドでArray#zip -> Array#each_with_indexを使用するようにしてオブジェクトの生成を減らすよう修正しています。


Use Path::Pattern#match? that uses Regexp#match? where MatchData is not in need

actionpack/lib/action_dispatch/journey/path/pattern.rbactionpack/lib/action_dispatch/journey/router.rbの修正です。

MatchDataが不要な場合にRegexp#match?を使うよう修正しています。


Avoid extra hash creation

actionpack/lib/action_dispatch/http/cache.rbの修正です。

merge_and_normalize_cache_control!メソッドで不要なHash作成処理を削除しています。


:golf:

actionpack/lib/action_dispatch/http/cache.rbの修正です。

merge_and_normalize_cache_control!メソッドから不要な変数を削除しています。


return early

actionpack/lib/action_dispatch/http/cache.rbの修正です。

merge_and_normalize_cache_control!メソッドでオプションの設定が不要な場合アーリーリターンするよう修正しています。


No need to dup temporary strings

actionpack/lib/action_dispatch/journey/router.rbの修正です。

serveメソッドから不要なdup処理を削除しています。


Use Regext#match? where MatchData is not needed

MatchDataが不要な場合にRegexp#match?を使うよう修正しています。


Prefer String#== over String#=== for clarity

actionpack/lib/action_dispatch/journey/route.rbの修正です。

String#===を使う必要が無い箇所で===を使用していたのを、String#==を使うよう修正しています。


Partially revert 4a9ef5e1202cdab1882989eb561b0dc854c9891b

activerecord/test/cases/test_case.rbの修正です。

Use Regext#match? where MatchData is not neededの対応でテストがコケるようになってしまったので、一部元のコードに戻しています。


Fix typo s/higlights/highlights/ [ci skip]

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

Active Storage assignment behavior changeの項のexampleコードでメソッド名をタイポしていたのを修正しています。


Silence method redefined warnings

activerecord/test/cases/reflection_test.rbの出力です。

メソッド再定義の警告が出ている箇所をsilence_warningsで囲むよう修正しています。


Fix typo in ActionMailbox::InboundEmail::MessageId [ci skip]

actionmailbox/app/models/action_mailbox/inbound_email/message_id.rbのdocの修正です。

ActionMailbox::InboundEmail::MessageId.create_and_extract_message_id!`メソッドのdocのグラマーの修正を行っています。