2024/08/22分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actiontext/CHANGELOG.md
- Strip
content
attribute if the key is present but the value is empty - Add
store_if_blank
option tohas_rich_text
- Add support for
ActiveRecord::Point
type casts usingHash
values - Infer default
:inverse_of
option fordelegated_type
- Deserialize database values before decryption.
This should not be in the codeblock
activesupport/lib/active_support/notifications.rb
のdocの修正です。
ActiveSupport::Notifications
のdocのフォーマットを修正しています。
ActionText: Strip content attribute if it's empty during render_attachments
actiontext/lib/action_text/content.rb
の修正です。
Action Textのcontentを編集後再度アクセスした場合に、リッチテキスト領域に追加された画像やその他の添付ファイルがエディターに表示されないバグがあったのを修正しています。
Merge pull request #44841 from sdrew/ar-point-hash
activerecord/lib/active_record/connection_adapters/postgresql/oid/point.rb
の修正です。
Hash
を使用した値に対する、ActiveRecord::Point
型キャストのサポートを追加しています。これにより、ActiveRecord::Point
を数値の:x
と:y
のキーを持つハッシュから、キャストまたはシリアル化できるようになっています。
class PostgresqlPoint < ActiveRecord::Base attribute :x, :point attribute :y, :point attribute :z, :point end val = PostgresqlPoint.new({ x: '(12.34, -43.21)', y: [12.34, '-43.21'] }) ActiveRecord::Point.new(12.32, -43.21) == val.x # => true ActiveRecord::Point.new(12.32, -43.21) == val.y # => true
Fix center alignment issue in guides blocks
rails guideの修正です。
guide内のヒントとメモブロックの中央揃えの位置がずれていたのを修正しています。
Infer default :inverse_of
option for delegated_type
activerecord/lib/active_record/delegated_type.rb
の修正です。
delegated_type
でmodel名から自動でinverse_of
の指定を行うよう修正しています。
class Entry < ApplicationRecord delegated_type :entryable, types: %w[ Message ] # => `inverse_of: :entry` end
合わせて、独自のassociation名を使用している場合のために、delegated_type
にinverse_of
オプションを指定出来るよう対応しています。
Fix raw_post raising when rack.input is nil
actionpack/lib/action_dispatch/http/request.rb
の修正です。
rack.input
がnilの場合に、Request#raw_post
メソッドがNoMethodError
をraiseするバグがあったのを修正しています。元々rack.input
がnilになることはなかったのですが、Rack 3.1からoptionalになりnilになることがあるため。
Fix Action Mailbox assuming request.body present
actionmailbox/app/controllers/action_mailbox/ingresses/relay/inbound_emails_controller.rb
の修正です。
rack.input
がnilの場合に、inbound emailの作成処理でNoMethodError
をraiseするバグがあったのを修正しています。元々rack.input
がnilになることはなかったのですが、Rack 3.1からoptionalになりnilになることがあるため。
Merge pull request #52597 from flavio-b/patch-1
rails guideのAction Controller Overview
の修正です。
RESTful Downloads
セクション内の独自のmime typeを登録する方法について説明している箇所に、Railsにデフォルトで登録されているmimeの確認方法や、追加する際のメソッドの詳細についての説明を追加しています。
Improve Action Text System Test coverage
actiontext/test/system/rich_text_editor_test.rb
、
actiontext/test/system/system_test_helper_test.rb
の修正です。
Action TextのActive Storageとのintegrationに関する挙動を確認するためのテストを追加しています。
Fix linting issues in action_controller_overview.md
rails guideのAction Controller Overview
の修正です。
lintでエラーになる箇所があったのを修正しています。
Merge pull request #52637 from jlduran/cleanup-service-worker-white-space
railties/lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
の修正です。
行末尾の不要な空白を削除しています。
Add store_if_blank
option to has_rich_text
actiontext/lib/action_text/attribute.rb
の修正です。
has_rich_text
メソッドに、値が空の場合に保存するかどうかを指定するためのstore_if_blank
オプションを追加しています。store_if_blank
がfalse、かつ、値が空の場合、保存は行われないようになります。
class Message has_rich_text :content, store_if_blank: false end Message.create(content: "hi") # ActionText::RichText が作成される Message.create(content: "") # ActionText::RichText が作成されない
Merge pull request #52490 from Uaitt/improve-credentials-help-output
railties/lib/rails/commands/credentials/USAGE
の修正です。
bin/rails credentials:help
で表示されるテキストのフォーマットや言い回しを修正しています。
Merge pull request #52357 from Uaitt/clarify-upgrading-ruby-on-rails-guide
rails guideのUpgrading Ruby on Rails
の修正です。
The Upgrade Process
セクション内のRailsを更新する手順を説明している箇所で、bundle update
コマンドにgem名(rails
)を指定するよう修正しています。
Merge pull request #52546 from Uaitt/config-assets-quiet-improvements
rails guideのConfiguring Rails Applications
の修正です。
config.assets.quiet
について説明している箇所内のdevelopment.rb
をconfig/environments/development.rb
に修正しています。
Encryption casting with encrypts
before serialize
(#52650)
Active Recordの修正です。
Active Record EncryptionでDBの値を復号化する前にdeserialize処理を行うよう修正しています。PostgreSQLのbinary value(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bytea
)をencrypt
に使用した場合に、deserializeが先に行われないと値の復号が正しく行えない為。