なるようになるブログ

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

rails commit log流し読み(2023/03/28)

2023/03/28分のコミットです。

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

activestorage/CHANGELOG.md

activerecord/CHANGELOG.md


Update active_record_migrations.md

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

Using reversibleの項にあるexampleコードについて説明している箇所で、exampleコードで行われる処理についての説明が不足していたのを追加しています。


Remove mini_mime usage in favour of marcel

Active Storageの修正です。

Active Storage内部でmime関連の処理を行うのにmini_mimemarcelと2つのgemを使用していたのを、全ての処理でmarcelを使用するようにして、mini_mimeは依存から削除するよう修正しています。


Merge pull request #47777 from shouichi/use-google-cloud-env

activestorage/lib/active_storage/service/gcs_service.rbの修正です。

GCSでemailを取得するのに、google-cloud-env gemが提供しているメソッドを使用するよう修正しています。


Output generator usage on two lines

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

railsコマンドのusageを2行にわけて表示するよう修正しています。


Merge pull request #47781 from brenda-daroz/fix-hover-welcome-page

railties/lib/rails/templates/rails/welcome/index.html.erbの修正です。

welcomeページのロゴをhoverした際に画像が正しく切り替わるよう修正しています。


Merge pull request #47773 from Roriz/feat/custom-header-direct-upload

Active Storageの修正です。

direct uploadでcustom headerを指定する際に、Authorization bearer tokenなどのauthorization tokenをheaderに指定出来るよう修正しています。


Copy edit last PR

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

各箇所の言い回しやタイポの修正を行っています。


fix(ac-redis): rescue BaseConnectionError in redis <5

actioncable/lib/action_cable/subscription_adapter/redis.rbの修正です。

redis gem 5未満を使用している場合に、存在しない定数を参照している箇所があったのを修正しています。


Merge pull request #47548 from the-spectator/tagged_logging_example

activesupport/lib/active_support/tagged_logging.rbのdocの修正です。

TaggedLogging moduleのdoc内のexampleコードの変数名をより適切な名前に変更しています。


Fix dumping enum definitions from other schemas

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

PostgreSQLのschema dumpで他のschemaのenumが含まれてしまっていたのを修正しています。


Implement marshal_dump and marshal_load on ActiveRecord::Base

Active Recordの修正です。

Ative RecordのmodelをMarshalでserializeした際のフォーマットを変更し、極力Railsとして必要な情報のみを含むよう修正しています。フォーマットの変更はbreaking changeな為、config.active_record.marshalling_format_version7.1、またはload_defaults7.1を指定した場合のみ新しいフォーマットが使用されるようになっています。

背景として、Ruby 3.2でmarshal dumpした際のデータのフォーマットが変わってしまっており、その影響で、特定のパターンのActive Recordのmodelのdeseriazlizeが出来ない、という問題があった為対応したとの事です。

参考:


Ensure Inflector methods return un-frozen strings

activesupport/lib/active_support/inflector/methods.rbの修正です。

Optimize camelize for single wordの対応によりInflector#camelize、#underscore`がfrozen Stringを返すようになってしまったのを、un-frozen Stringを返すよう修正しています。frozen Stringだと戻り値を使用している他の処理でエラーになってしまう為。