なるようになるブログ

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

rails commit log流し読み(2019/04/24)

2019/04/24分のコミットです。

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

activestorage/CHANGELOG.md


Merge pull request #36063 from albertoalmagro/finish-documentation-for-after-save-commit

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

Transaction Callbacksの項にあるafter_commitを使用した場合のexampleコードを削除しています。ガイドの他の部分に同様のexampleコードがある為。


Merge pull request #36061 from shioyama/update_comment

activemodel/lib/active_model/attribute_methods.rbのdocの修正です。

attribute_method_matchers_matchingメソッド内の動作についてのコメントが、現在の挙動と一致しない内容になっていたのを修正しています。


Make docs on form_with_generates_ids config option match the value

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

config.action_view.form_with_generates_idsのデフォルト値の説明が実際の値と異なっていたのを修正しています。


Update document about perform_caching's default value

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

config.action_controller.perform_cachingconfig.action_mailer.perform_cachingのデフォルト値の説明が実際の値と異なっていたのを修正しています。


Make association builder methods private

Active Recordの修正です。

内部でだけ使用する想定のassociation builder methodsの可視性をprivateに変更しています。


Remove redundant test setups in log_subscriber_test

actionpack/test/controller/log_subscriber_test.rbの修正です。テストの各箇所でconfig.perform_cachingにtrueを指定していたのを、テストの前処理で値を指定するよう修正しています。


Fix rdoc rendering for push alias symbol

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

CollectionProxy#<<メソッドのdoc内の<<が正しく表示されてなかったのを修正しています。


Remove action_controller.perform_caching from api app's configs

railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.ttrailties/lib/rails/generators/rails/app/templates/config/environments/production.rb.ttの修正です。

API-only Applicationsの場合、view cacheに関するconfigをデフォルトで生成しないよう修正しています。API-only Applicationsだとview cacheに関するmoduleがデフォルトでロードされない為。


Rename local variable n to name

activerecord/lib/active_record/associations/builder/belongs_to.rbactiverecord/lib/active_record/dynamic_matchers.rbの修正です。

nameを保持する為の変数名が、nになっている箇所があったのをnameに修正しています。


Merge pull request #35852 from larouxn/resurrection

railties/lib/rails/generators.rbrailties/lib/rails/generators/rails/assets/assets_generator.rbの修正です。

Webpacker対応の際に削除されたjavascriptsjavascript_engineオプションを戻しています。

coffee-railsを引き続き使用し続ける場合に、これらのオプションが必要(coffee-railsで使用している)な為。


Lazy allocate @_start_transaction_state

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

インスタンスの初期化時に@_start_transaction_stateの初期化(空Hashを指定)を行っていたのを、初期値はnilにして実際に使用する際にHashを指定するよう修正しています。


Simplify restore state condition

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

restore_transaction_record_stateメソッド内、state conditionのrestore処理をリファクタリングしています。


Re-organize init_internals

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

init_internalsリファクタリングとして、重複してあった@new_recordの初期化処理を修正、及び、define_attribute_methodsメソッドの呼び出しをinit_internalsで行うよ修正しています。


Fix sliced IN clauses to be grouped

Active Recordの修正です。

スライスされたIN句をグループ化するよう修正しています。合わせて、in_clause_lengthに関する処理をArel visitorのベースクラスで行うようリファクタリングしています。


Avoid redundant attribute_alias? before attribute_alias

Active Recordの修正です。

attribute aliasを取得する際に、attribute_aliasメソッドを呼び出す前にattribute_alias?かどうかをチェックしてからメソッドを呼び出していたのを、 attribute_alias?によるチェックは行わないよう修正しています。alias attributeの処理を高速化する為。


Don't fail ImageAnalyzer on unsupported types

activestorage/lib/active_storage/analyzer/image_analyzer.rbの修正です。

ImageMagickでファイルの解析を行う前に、ImageMagickでサポートしているフォーマットかどうかをチェックし、サポートしていないフォーマットの場合は解析処理を行わないよう修正しています。

サポートしていないフォーマットの解析処理を行った場合に処理全体が終了してしまう(解析エラー時のexceptionをハンドリングしていない為)のを避ける為。


Update changelog for a bug-fix to read better [ci skip]

activestorage/CHANGELOG.mdの修正です。

先のImageMagickの対応のエントリーのグラマーの修正を行っています。