なるようになるブログ

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

rails commit log流し読み(2023/03/21)

2023/03/21分のコミットです。

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

activerecord/CHANGELOG.md


Do not allocate the first path character in asset helper

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

asset_pathメソッドでオブジェクトの生成数を減らすようリファクタリングしています。


PostgreSQL adapter uses :host instead of :hostname for connection parameters

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

PostgreSQL adapterで接続時のパラメータにhostnameを使用していたのをhostを使用するよう修正しています。hostnameは少なからず現在は指定出来るオプションではなく、hostが正しいパラメータ名な為。


Allow SQL Warnings to be ignored using error codes

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

SQL warningをreportする機能で、ignoreするエラーをエラーコードで指定出来るよう修正しています。

# Configure allowlist of warnings that should always be ignored
config.active_record.db_warnings_ignore = [
  "1062", # MySQL Error 1062: Duplicate entry
]

Accept composite primary key in id=

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

id=メソッドにcomposite primary keyを指定出来るよう修正しています。


Fix nullification of has_many :through association with query_constraints

activerecord/lib/active_record/associations/through_association.rbactiverecord/lib/active_record/persistence.rbの修正です。

has_many :through + query_constraintsを使用しているassociationに対してのnullification([]を指定しての初期化)が動作するよう修正しています。