なるようになるブログ

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

rails commit log流し読み(2023/06/05)

2023/06/05分のコミットです。

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

actionpack/CHANGELOG.md

activerecord/CHANGELOG.md


Revert "Switch to i18n master branch temporary to fix actionview test"

i18n gemについて、masterブランチを使用するよう修正した、Switch to i18n master branch temporary to fix actionview testをRevertしています。i18n gemの新しいバージョンがリリースされ、masterブランチのコードを直接参照する必要がなくなった為。


ActiveSupport::Deprecator stop using Singleton

activesupport/lib/active_support/deprecation.rbactivesupport/lib/active_support/deprecation/instance_delegator.rbの修正です。

ActiveSupport::DeprecatorSingletonを使用しないよう修正しています。Deprecate ActiveSupport::Deprecation singleton usageで、ActiveSupport::DeprecationSingletonに依存した処理をdeprecatedにしており、それのフォローアップ対応。


Remove :github gem source from template Gemfile

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

rails newで生成するGemfileからgit_source(:github)の定義を削除してます。Bundler側で同じ処理が提供されており、Rails側で独自に定義する必要が無い為。


improve quoted parameters in mime types

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

MIME-typeにparameterが指定されたtypeを指定出来るよう修正しています。これにより、例えば、application/vnd.api+json; profile="https://jsonapi.org/profiles/ethanresnick/cursor-pagination/" ext="https://jsonapi.org/ext/atomic"のようなMIME-typeが登録出来るようになっています。


Support batching using composite primary keys and multiple column ordering

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

batch系のメソッド(find_each, find_in_batches 及び in_batches)のorderオプションに、複数カラムを指定出来るよう修正しています。composite primary keyを使用しているテーブルに対してbatch処理を行う場合に、key毎にorderを指定出来るようにする為。

class Order < ActiveRecord::Base
  self.primary_key = [:id_1, :id_2]
end

Order.find_each(order: [:asc, :desc])
# 上記の場合、`:id_1`は`asc`でsortが行われ、`:id_2`は`desc`でsortが行われる。