2024/02/10分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activestorage/CHANGELOG.md
Workaround a Ruby bug that can cause a VM crash
activesupport/lib/active_support/tagged_logging.rb
の修正です。
object_id
にアクセス済みのProc
objectのcloneがあり、そのcloneがGCされた場合にRubyがクラッシュしてしまう、というバグがリリース済みのRubyにあり、そのバグの回避策として、cloneした方のobjectでもobject_id
を参照するよう修正しています。
Active Storageの修正です。
attachmentにvariantが複数定義されている、かつ、variantにpreviewableなtypeが指定されている、かつ、それぞれにpreprocessed: true
が指定されている場合に、fileがattachされた際にそれぞれのvariantでpreview用のファイル生成処理が同時に実行されてしまい、結果不要なファイルやattachmntと紐付かないファイル(attachmentをpurgeしても消えないファイル)が生成されてしまうバグがあったのを修正しています。
Prefer to reference git's default configuration, not bespoke
railties/lib/rails/generators/rails/app/templates/gitignore.tt
のコメントの修正です。
git ignoreの設定をする際に、独自のglobalのexcludesfileを設定するよう説明していたのを、gitがデフォルトで参照するignore fileを使用するよう説明を修正しています。
Disambiguate language around when code stops re: redirect_to
rails guideのLayouts and Rendering in Rails
の修正です。
The Difference Between render and redirect_to
セクションの言い回しを修正しています。
docs:expand documentation on has_one_attached method.
activestorage/lib/active_storage/attached/model.rb
のdocの修正です。
has_one_attached
メソッドのdoc内の:dependent
オプションについて説明している箇所に:purge_later
オプションについての説明を追加しています。
Merge pull request #51006 from kddnewton/parse-with-prism
railties/lib/rails/test_unit/test_parser.rb
の修正です。
TestUnit::TestParser
で使用できる場合ripperではなくprismを使用してパース処理を行うよう修正しています。
Transform actionpack documentation to Markdown
Action Packのdocの修正です。
docのフォーマットをMarkdownに変更しています。
Update activestorage/app/models/active_storage/blob/representable.rb
activestorage/app/models/active_storage/blob/representable.rb
のdocの修正です。
内部用のAPIがAPI docに表示されないよう修正しています。
Merge pull request #49897 from glaucocustodio/main
rails guideのAction Cable Overview
の修正です。
PostgreSQL Adapter
セクションに、PostgreSQLのNOTIFY
にはデータサイズが8000 bytesまでであるという制限がある旨説明を追加しています。
参考: PostgreSQL: Documentation: 16: NOTIFY
Add class name to enum validation exception message
activerecord/lib/active_record/enum.rb
の修正です。
enumの定義処理でエラーになった場合のエラーメッセージにエラーになったクラス名を含むよう修正しています。
Merge pull request #51017 from p8/activesupport/document-time-zone-create
activesupport/lib/active_support/values/time_zone.rb
のdocの修正です。
ActiveSupport::TimeZone.create
メソッドのdocが正しく表示されるようフォーマットの修正を行っています。
Merge pull request #50992 from KJTsanaktsidis/ktsanaktsidis/persist_logger_tags_until_as_event
railties/lib/rails/rack/logger.rb
の修正です。
config.log_tags
で設定したloggerのtagの設定が、request.action_dispatch
handler内でも使用されるよう修正しています。
Add WebP as a new framework default image type
railties/lib/rails/application/configuration.rb
の修正です。
Rails 7.2以降の設定が有効になっている場合、image/webp
をActive Storageのデフォルトのimage typeに追加するよう修正しています。
Add note about imagemagick / libvips support being required
railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt
の修正です。
WebPを使用する場合、imagemagick/libvipsがWebPをサポートする設定になっている必要がある旨コメントを追加しています。
rails guideのConfiguring Rails Applications
の修正です。
config名の並びをアルファベット順に修正しています。
Deprecate defining enums with keywords args
activerecord/lib/active_record/enum.rb
の修正です。
enum
をkeyword argsを使用してい定義する処理をdeprecatedにしています。
class Function > ApplicationRecord enum color: [:red, :blue], type: [:instance, :class] end
上記書き方はNGで、下記のようにenum毎に定義する必要があります。
class Function > ApplicationRecord enum :color, [:red, :blue] enum :type, [:instance, :class] end
元々は前者の書き方しか出来なかったのですが、Rails 7.0から後者の書き方が出来るようになった、かつ、オプションを定義する際に_
を使用しないで良い等のメリットがあり、前者の書き方をサポートし続ける必要は無くなっている為、deprecatedにしています。
Update 7.0 release notes re inflections and the once autoloader
rails guideのUpgrading Ruby on Rails
の修正です。
Autoloading during initialization
セクションに、once
autoloaderでロードされる処理でinflectionの設定をしたい場合、config/initializers/inflections.rb
ではなく、config/application.rb
にそのinflectionを定義する必要がある旨説明を追加しています。