なるようになるブログ

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

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

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

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

actionmailbox/CHANGELOG.md

activesupport/CHANGELOG.md

activerecord/CHANGELOG.md


feat: use config pk type in Action Mailbox migration

actionmailbox/db/migrate/20180917164000_create_action_mailbox_tables.rbの修正です。

configでprimary_key_typeを指定している場合に、action_mailbox_inbound_emailsのtableで使用するprimary keyにconfigで指定されているtypeを使用するよう修正しています。


Avoid nested #with_raw_connection

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

Trilogy::DatabaseStatements#select_allメソッドでnestしたwith_raw_connectionの呼び出しを行わないよう修正しています。with_raw_connectionのblockの中で実行したwith_raw_connectionで、query実行時にconnection errorが発生した場合に、外側のwith_raw_connectionでそのエラーが発生したconnectionが再度使用され、こちらのqueryの実行もエラーになってしまうのを避ける為。


Improve cache performance for bare string values

activesupport/lib/active_support/cache/serializer_with_fallback.rbの修正です。

cache entryが単純な文字列の場合のcache formatを、より効率よく処理が行えるよう変更しています。この変更は、config.load_defaults 7.1 または、config.active_support.cache_format_version = 7.1指定した場合のみ使用されるようになっています。


Merge pull request #48125 from jonathanhefner/message_pack-cache-serializer-silence-warning

activesupport/lib/active_support/cache/serializer_with_fallback.rbの修正です。

テスト実行時にmsgpack gem経由で出力されるwarningが表示されないよう修正しています。


Add documentation for ActionText::Content [ci-skip]

actiontext/lib/action_text/content.rbのdocの修正です。

ActionText::Content class、及び、class配下の各メソッドにdocを追加しています。


Make increment_counter/decrement_counter accept an amount argument

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

increment_counter / decrement_counterにincrement / decrementする数を指定出来るよう修正しています。

Post.increment_counter(:comments_count, 5, by: 3)

Document ActionText::Attachable [ci-skip]

actiontext/lib/action_text/attachable.rbのdocの修正です。

ActionText::Attachable module、及び、module配下の各メソッドにdocを追加しています。


Note cache_format_version in framework defaults

railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.ttの修正です。

config.active_support.cache_format_versionについての説明を追加しています。なお、あくまで説明で、実際の値はconfig/application.rbに指定する必要があります。