なるようになるブログ

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

rails commit log流し読み(2024/05/29)

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

actionpack/CHANGELOG.md


Update spelling: Getting Start to Getting Started

rails guideのGetting Started with Railsの修正です。

guide内のタイポの修正を行っています。


Merge pull request #51925 from zzak/re-51395-proxy_association

activerecord/lib/active_record/associations/collection_proxy.rbのdocの修正です。

CollectionProxy#proxy_associationメソッドをpublic APIに変更しています。collectionからassociation objectを取得するpublicな方法を提供するため。


Use docker.io as the default registry for Ruby images

railties/lib/rails/generators/rails/app/templates/Dockerfile.ttの修正です。

Rubyのdocker imageをpullするデフォルトのレジストリregistry.docker.comからdocker.ioに変更しています。docker.ioがDocker CLI等で使われるデフォルトのレジストリなため。


Add CSP mapping for 'wasm-unsafe-eval'

actionpack/lib/action_dispatch/http/content_security_policy.rbの修正です。

Content Security Policyでwasm-unsafe-eval ポリシーを指定出来るよう修正しています。


Improve ActionCable TestCookieJar interface

actioncable/lib/action_cable/connection/test_case.rbの修正です。

Action Cableのテスト内で、cookieにHashのvalueを指定出来るよう修正しています。


Merge pull request #51892 from florin555/fix_pretty_print

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

ActiveRecord::Core#pretty_printメソッドを、attribute_for_inspectメソッドを使用するようリファクタリングしています。


Merge pull request #50828 from akhilgkrishnan/add-example-for-month-field-tag

actionview/lib/action_view/helpers/form_tag_helper.rbのdocの修正です。

form helper tagのdocにexamplesを追加しています。


Index Result rows rather than to convert them into hashes

activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rbactiverecord/lib/active_record/result.rbの修正です。

ActiveRecord::Result#eachメソッドでDBから取得したrowsをHashに変換していたのを、元のデータ(Array)のまま扱うようリファクタリングしています。Hashへの変換がメモリをくう処理になってしまっており、メモリ使用量を減らせるようにするため。


Define Digest::UUID.nil_uuid

activesupport/lib/active_support/core_ext/digest/uuid.rbの修正です。

RFC 4122で定義されているNil UUID(全ての値が0)を返すDigest::UUID.nil_uuidメソッドを追加しています。

参考:rfc4122.txt


Add a Rails Guide called "Tuning Performance for Deployment".

PumaとCRubyのconcurrencyとperformanceのついて説明した、Tuning Performance for Deployment guideを追加しています。


Restore automatic detection of processor count in default puma config

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

Pumaのworker countのデフォルト値を、processor countになるよう修正しています。concurrent-ruby 1.3 でcgroupsの設定からCPU数を取得する為のメソッドが追加されており、そちらを使用するようになっています。

参考:Add Concurrent.usable_processor_count that is cgroups aware