なるようになるブログ

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

rails commit log流し読み(2020/06/22)

2020/06/22分のコミットです。

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


[guide][association_basics] Fix grammar for a single example

rails guideのActive Record Associationsの修正です。

Single Table Inheritance (STI)の項のグラマーの修正を行っています。


More exercise tests for first nth and last on dirty collection

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

dirty collectionに対するfirst nth、及び、lastを指定した場合のテストを追加しています。


Merge pull request #39677 from kamipo/allow_capital_characters_for_enum_names

enumのscopeを作成する際に、enumの値をparameterize + underscoreした値でscopeを作成するよう修正した、 Generate nicer scope names from enumsをRevertしています。

enumにcapital characterを使用していた場合に、生成されるscope名が変わってしまう(breaking changeになってしまう)為。


Use Array(ActiveSupport::ToJsonWithActiveSupportEncoder)#to_json and Hash(ActiveSupport::ToJsonWithActiveSupportEncoder)#to_json for Ruby 2.8.0

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

ActiveSupport::ToJsonWithActiveSupportEncoderをpreprendする際の順番を修正しています。

Rubyでprepend(includeも)した際にiclassesにも影響があるよう変更されており、それにより想定とは違うクラスのto_jsonが呼ばれるようになってしまった為。

参考: Bug #9573: descendants of a module don't gain its future ancestors, but descendants of a class, do - Ruby master - Ruby Issue Tracking System