なるようになるブログ

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

rails commit log流し読み(2024/04/11)

2024/04/11分のコミットです。

CHANGELOGへの追加はありませんでした。


Use relative paths on AR basics guide [ci skip]

rails guideのActive Record Basicsの修正です。

exampleファイルのパスに絶対パスを使用している箇所があったのを相対パスに修正しています。他の箇所と合わせるため。


Merge pull request #51537 from yahonda/diag_rails_nightly_391

railties/test/command/help_integration_test.rbの修正です。

helpコマンドのテストがRuby 3.4でエラーになってしまっていたのを修正しています。


Merge pull request #51531 from fatkodima/fix-sqlite-copy-virtual-columns

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

SQLite3でtableに対してalter処理を実行する際に、virtual columnの情報が失われてしまうバグがあったのを修正しています。


Merge pull request #51540 from vahe/lazily_load_schema_cache-docs-cmment-cleanup

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

lazily_load_schema_cache accessorのコメントに古い挙動についての説明が残っていたのを修正しています。


Respond with 406 when a browser is blocked by allow_browser

Action Pack、railtiesの修正です。

allow_browserメソッドでサポートしていないブラウザからのアクセスだった場合に返すhttp statusのデフォルトを426から406に変更しています。426はサポートしていないプロトコルによるアクセスを表すものであり、ブラウザのバージョン等によるアクセス拒否の場合、406の方が適切な為。


Merge pull request #51544 from rhiroe/doc/Updated-the-default-digest-algorithm-used-for-key-derivation-in-ActiveRocord-Encryption-to-SHA256

rails guideのActive Record Encryptionの修正です。

config.active_record.encryption.hash_digest_classとデフォルト値が実際の値と異なっていたのを修正しています。

rails commit log流し読み(2024/04/10)

2024/04/10分のコミットです。

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

activesupport/CHANGELOG.md


Remove example filepaths from code blocks in guides

guides/rails_guides/markdown/renderer.rbの修正です。

code blockからcodeが記載されているファイルパスを削除しています。codeをコピーする際に不要な情報であるファイルパスが含まれないようにする為。


Add more ostruct requires

ostructのrequireが足りてないと思われている箇所にrequireを追加しています。


Add missing ostruct require on AR test suite

ostructのrequireが足りてないと思われている箇所にrequireを追加しています。


Remove usage of OpenStruct

OpenStructを使用している箇所をStructを使用するよう修正しています。


Fix fourth column issue in guides dropdown

guides/assets/stylesrc/_main.scssの修正です。

guideのdropdownで4列目が正しく表示されてなかったのを修正しています。


Fix ActiveJob::EnqueueAfterTransactionCommit API

Active Job、Active Supportの修正です。

Active Recordのtransaction内でActive Jobのenqueueが行われた場合に、自動でtransaction commit後にjobのenqueueを行うよう修正した、Automatically delay Active Job enqueues to after commitの対応の影響で、perform_laterの戻り値が変わってしまっていたのを、極力元と同じ値(成功時はjobのinstance、失敗時はfalse)を返すよう修正しています。

合わせて、この対応のテストの為に、stub_constメソッドにstub対象のconstantが存在しない場合に、エラーをraiseしないよう指定する為のexists: false引数を追加しています。


Merge pull request #51536 from jathayde/scrollbar-color-fix

guides/assets/stylesrc/_main.scssの修正です。

rails guideで、Safari/Webkitを使用していた場合のscrollbarのbackground colorがredになってしまっていたのを修正しています。


form_helper documentation using article instead of post

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

exampleコードで使用するmodel名をPostからArtcleに変更しています。Postだとmethod名もpostで紛らわしい為。

rails commit log流し読み(2024/04/09)

2024/04/09分のコミットです。

CHANGELOGへの追加はありませんでした。


Minor tweaks / improvements to recent changelog/api docs [ci skip]

docの修正です。

各docのグラマーや用語の修正を行っています。


Fix textdecorator specificity on hovering in index

guides/assets/stylesrc/_main.scssの修正です。

rails guideのindexページで、hover時のtext-decoratorとcolorを正しく使用されてなかったのを修正しています。


Raise when both :force and :if_not_exists provided to create_table

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

create_table:force:if_not_existsオプションを同時に指定した場合に、ArgumentErrorをraiseするよう修正しています。


[RF-DOCS] Action View Helpers Documentation [ci-skip] (#51432)

rails guideのAction View Helpersの修正です。

guide全体について、セクションの見直し、exampleやメソッドの追加、言い回しの修正等を行っています。


Remove duplicated features attribute on devcontainer.json.tt

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

重複していたfeatures attributeの指定を削除しています。


Fix minor typos in enqueue_after_transaction_commit default docs

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

コメント内のタイポを修正しています。


Properly escape paths in erb example code blocks in guides [ci-skip]

rails guideのThe Asset Pipelineの修正です。

exampleコード内のコメント部分を適切にエスケープするよう修正しています。


Use SQL comments for SQL code blocks in guides [ci-skip]

rails guideのActive Record Basicsの修正です。

SQL code block内のコメントにSQLのcomment指定(--)を使用するよう修正しています。


Merge pull request #51355 from asavageiv/alan/update-docs

rails guideのActive Record Basicsの修正です。

Creating Namespaced Modelsセクションのexampleコードで、他のセクションと同じmodel名を使用するよう修正しています。


Ensure association's foreign_key: and query_constraints: options behave the same

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

associationのforeign_keyオプションがArrayの場合、query_constraintsに同じ値を設定するよう修正しています。composite foreign keyを使用している場合に自動のinverse処理が正しく動作するようにする為。

rails commit log流し読み(2024/04/08)

2024/04/08分のコミットです。

CHANGELOGへの追加はありませんでした。


Improve ActionCable redis config example [skip ci]

rails guideのAction Cable Overviewの修正です。

redis用のconfigのexampleから、不要な{}を削除しています。


Fix a typo in activerecord/CHANGELOG.md

activerecord/CHANGELOG.mdの修正です。

TransactionTransationにタイポしていたのを修正しています。


Fix small typo's in ActiveRecord Changelog [ci-skip]

activerecord/CHANGELOG.mdの修正です。

各エントリーのタイポの修正、及び、フォーマットの修正を行っています。


Update default value for content_types_allowed_inline in guides

rails guideのConfiguring Rails Applicationsの修正です。

config.active_storage.content_types_allowed_inlineのデフォルト値を最新の内容に更新しています。

rails commit log流し読み(2024/04/06)

2024/04/06分のコミットです。

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

actioncable/CHANGELOG.md


Record ping on every actioncable message

Action Cableの修正です。

pingwelcome message typeでしかconnectionを維持するようになってなかったのを、全てのAction Cableのmessageで受信した際にconnectionがactiveである旨判断するよう修正しています。


Update enqueue_after_transaction_commit changelog [ci-skip]

activejob/CHANGELOG.mdの修正です。

enqueue_after_transaction_commitに指定出来る値を正しい内容に更新しています。


Merge pull request #51497 from bensheldon/preparable-in

activerecord/lib/arel/visitors/to_sql.rbの修正です。

INにsubselectで取得した値を指定する場合に、Prepared Statementsを使用出来る場合はPrepared Statementsを使用するよう修正しています。


Update active_record_querying.md

rails guideのActive Record Query Interfaceの修正です。

各箇所のグラマーやフォーマットの修正を行っています。


Merge pull request #51498 from Uaitt/fields_for_documentation_improvements

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

fields_forメソッドのdoc内の言い回しを修正しています。


Counter cache columns are not marked as readonly [skip ci]

activerecord/lib/active_record/associations.rbのdoc、及び、rails guideのActive Record Associationsの修正です。

counter cacheで使用されるcolumnはreadonlyが設定される旨記載があったのを削除しています。現在はreadonlyが設定されるようにはなっていない為。

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

2024/04/05分のコミットです。

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

activerecord/CHANGELOG.md


Merge pull request #51478 from kmcphillips/mysql-parse-version-error

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rbactiverecord/lib/active_record/errors.rbの修正です。

MySQL databaseが不正なversion stringを返した場合に、ActiveRecord::ActiveRecordErrorをraiseするよう修正しています。DBへの接続にproxyを使用している場合に、proxyが誤った値を返すことがあるらしく、そのような場合に気づけるようにする為。


Add queries count to template rendering instrumentation

activerecord/lib/active_record/railties/controller_runtime.rbactiverecord/lib/active_record/runtime_registry.rbの修正です。

template rendering instrumentationにquery countを含むよう修正しています。

# Before
Completed 200 OK in 3804ms (Views: 41.0ms | ActiveRecord: 33.5ms | Allocations: 112788)

# After
Completed 200 OK in 3804ms (Views: 41.0ms | ActiveRecord: 33.5ms (2 queries, 1 cached) | Allocations: 112788)