なるようになるブログ

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

rails commit log流し読み(2020/12/28)

2020/12/28分のコミットです。

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


Merge pull request #39979 from tgxworld/speed_up_text_helper_excerpt

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

ActionView::Helpers::TextHelper#excerptメソッドについて、性能改善のリファクタリングを行っています。


Search for yarn.exe in bin/yarn

railties/lib/rails/generators/rails/app/templates/bin/yarn.ttの修正です。

bin/yarnでインストール済みのyarnを検索する際に、yarn.exeも検索対象とするよう修正しています。


Fix where on polymorphic association with non Active Record object

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

whereで0polymorphic associationにActive Record object以外の値を指定した場合に、ArgumentErrorになってしまうバグがあったのを修正しています。


Skip Spring in plugin dummy apps

railties/lib/rails/generators/rails/plugin/plugin_generator.rbの修正です。

plugin dummy appsでSpringがインストールされないよう修正しています。


Make sure job instrumentation keep return value

activejob/lib/active_job/instrumentation.rbの修正です。

Rails 6.1.0でretry_jobが新しいjobのインスタンスを返さないようになっていたのを、6.0までと同様に新しいjobのインスタンスを返すよう修正しています


Change IPAddr#to_json to match the behavior of the json gem

activesupport/lib/active_support/core_ext/object/json.rbの修正です。

IPAddr#to_jsonの戻り値がinstance variableの値を出力するフォーマットになっていたのを、to_sした結果を返すよう修正しています。

# Before:

IPAddr.new("127.0.0.1").to_json
# => "{\"addr\":2130706433,\"family\":2,\"mask_addr\":4294967295}"

# After:

IPAddr.new("127.0.0.1").to_json
# => "\"127.0.0.1\""

json gemの挙動と合わせる為。