なるようになるブログ

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

rails commit log流し読み(2021/11/03)

2021/11/03分のコミットです。

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

activerecord/CHANGELOG.md


Only wrap subscriber exceptions if there is more than one

activesupport/lib/active_support/notifications/fanout.rbの修正です。

subscriberのexceptionsのwrap処理を、exceptionsが複数ある場合のみ行うようにし、exceptionsが1つの場合はそのexceptionをそのまま返すよう修正しています。


Merge pull request #43570 from mctaylorpants/remove-glob-from-channel

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

app/channelsをload pathに設定する際に、file patternを指定したいのを、指定しないよう修正しています。現在はload pathにfile patternを指定する事は想定していない為。


Add accepts_nested_attributes_for support when using delegated_type (#41717)

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

delegated_typeaccepts_nested_attributes_forに指定出来るよう修正しています。

class Entry < ApplicationRecord
  delegated_type :entryable, types: %w[ Message Comment ]
  accepts_nested_attributes_for :entryable
end
Entry.create(entryable_type: 'Message', entryable_attributes: { content: 'Hello world' })
# => #<Entry:0x00>...