2018/06/12分のコミットです。
CHANGELOGへの追加はありませんでした。
Merge pull request #29939 from arthurchui/activerecord-delete-associations-loop
activerecord/lib/active_record/associations/collection_association.rb
の修正です。
CollectionAssociation#remove_records
メソッドでtarget
から既にあるassociationを削除する際に、Array#delete
を使用していたのを、Hash#select!
を使用するよう修正しています。
Hash
の方が高速(Arrayだと計算量がO(N2)だけど、HashだとO(N))な為。が、これについては次のコミットで別な形で再度修正されています。
Use -=
to change the update the collection on the association
activerecord/lib/active_record/associations/collection_association.rb
の修正です。
CollectionAssociation#remove_records
メソッドでtarget
から既にあるassociationを削除するのに-=
を使用するよう修正しています。
target=
メソッドを使用すると、associationがload済みになり、次にreaderにアクセスする際にqueryの実行が抑止出来る為。が、これはこれで別の問題があった為、また次のコミットで修正されています。
activerecord/lib/active_record/associations/collection_association.rb
の修正です。
associationを削除するのにtarget=
メソッドを使用せず、@target
を直接更新するよう修正しています。
ここでassociationをload済みにしてしまうと、オブジェクトが古い状態のままになってしまう場合がある為。
Merge pull request #32997 from utilum/dev_dep_guide_update_ast_requirements
Development Dependencies Install
guideに Active Storageのテストで必要なパッケージ(ffmpeg
、mupdf
等)のインストール方法についての説明を追加しています。
Merge pull request #33092 from utilum/warnings_in_contribute_guide
rails guideのContributing to Ruby on Rails
の修正です。
Warnings
の項でRUBYOPT=-W0
を指定するとwarningが表示されなくなる旨説明が記載されていたのですが、実際はその挙動にならない(warningは表示される)為、該当の説明を削除しています。
Merge pull request #33106 from marcandre/datecalc
activesupport/lib/active_support/core_ext/date_and_time/calculations.rb
の修正です。
DateAndTime::Calculations
moduleで曜日の管理をするのに、月曜が0
になっていたのを、日曜が0
になるよう修正しています。
曜日を計算するのにwday
から1引いてから計算する(Rubyのwdayは日曜が0ので、各メソッドでcurrent_day_number = wday != 0 ? wday - 1 : 6
というのを最初にやっていた)という不要な処理を削除する為。
Fix bug with eager_load in development environment
actionpack/lib/action_dispatch/journey/routes.rb
の修正です。
eager_load
をdevelopmentでtrueにしている、かつ、Routeが空の場合にArgumentError
が発生してしまうバグがあったのを修正しています。
Remove backticks around proejct names
rails guideのActive Storage Overview
、Development Dependencies Install
の修正です。
XQuartzやPoppler等のプロジェクト名をバッククォートで囲まないよう修正しています。
Fix active_model/errors docs [ci skip]
activemodel/lib/active_model/errors.rb
のdocの修正です。
ActiveModel::Errors#full_message
メソッドのdocから不要なインデントを削除しています。
Add changelog for #32956 [ci skip]
activemodel/CHANGELOG.md
の修正です。
ActiveModel::Errors#full_message
メソッドで出力するエラーメッセージのフォーマットを変更出来るよう対応した、Allow to override the full_message error formatについてCHANGELOGにエントリーを追加しています。
Add comma to example in guides/source/active_storage_overview.md [ci skip]
rails guideのActive Storage Overview
の修正です。
Attaching File/IO Objects
の項にあるexampleコードでカンマが不足していたのを修正しています。
Remove reference to session_store.rb initializer
actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
の修正です。
既に存在しないinitializer(config/initializers/session_store.rb
)に言及している箇所があったのを削除しています。