なるようになるブログ

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

rails commit log流し読み(2022/11/17)

2022/11/17分のコミットです。

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

activerecord/CHANGELOG.md


Support optional collation in create_table output.

activerecord/test/cases/adapters/mysql2/table_options_test.rbの修正です。

create_tableの出力にcollationが含まれている場合もテストが通るよう修正しています。MariaDB 10.9.4でcollationが出力されるようになった為。


Merge pull request #46362 from nycdotnet/connection-pool-docs [ci-skip]

activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rbのdocの修正です。

connectionは何かSQLを実行するメソッドが呼ばれた場合に自動でconnection poolから取得される事、及び、with_connectionメソッドは、既に取得済みのconnectionを保持している場合poolからの取得処理は行われない、等の挙動の詳細についての説明を追加しています。


Merge pull request #46265 from bdewater/query-logs-docs [ci-skip]

activerecord/lib/active_record/query_logs.rbのdoc、及び、 rails guideのDebugging Rails Applicationsの修正です。

ActiveRecord::QueryLogsのdocにQuery Logsに関するconfigやSQLCommenterに関する説明を追加、及び、Debugging Rails Applications guideにSQLのコメントについて説明したSQL Query Commentsセクションを追加しています。


Use 2 spaces for identation in ActiveSupport code examples [ci-skip]

Active Supportのdocの修正です。

各doc内のコードexampleで、インデントにスペース2つを使うよう統一しています。


Use 2 spaces for identation in ActionView code examples [ci-skip]

Action Viewのdocの修正です。

各doc内のコードexampleで、インデントにスペース2つを使うよう統一しています。


Raise on assignment to readonly attributes

Active Recordの修正です。

readonly attributesに値を設定した場合、値の設定が出来てしまっていた(DBに保存はされない)のを、exceptionをraiseするよう修正しています。互換性の為、デフォルトは元の挙動のままになっており、config.active_record.raise_on_assign_to_attr_readonlyにtrueを指定した場合(load_defaults 7.1で指定される)のみexceptionをraiseするようになっています。