2018/04/27分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Reduce extra object creations in TaggedLogging
activesupport/lib/active_support/tagged_logging.rb
の修正です。
TaggedLogging
でtagからStringを生成する際に、tagが一つしか無い場合は不要なオブジェクトを生成しないよう修正しています。
Reduce String allocations when building Action View tags
actionview/lib/action_view/helpers/tag_helper.rb
の修正です。
TagBuilder#tag_option
メソッドでString#grub
を使っていたのをString#grub!
を使うようにして、不要なオブジェクトが生成されないよう修正しています。
Don't try to destoy the given string via method argument
actionview/lib/action_view/helpers/tag_helper.rb
の修正です。
先のString#gsub!
を使用するにした対応の影響で、tagをescapeしない際にFrozenError
が発生してしまうようになっていたので、valueをdupするようにして対応しています。
Don't dup Strings when jsonifying
activesupport/lib/active_support/json/encoding.rb
の修正です。
EscapedString#to_json
メソッドで、String#grub
を使っていたのをString#grub!
を使うようにして、不要なオブジェクトが生成されないよう修正しています。
Address Style/StringLiterals
offence
actionview/lib/action_view/helpers/tag_helper.rb
の修正です。
Stringを生成するのにシングルクォートを使用していたのを、ダブルクォートを使用するよう修正しています。
Add test case that assigning belongs_to on destroyed object raises frozen error
activerecord/test/cases/associations/belongs_to_associations_test.rb
の修正です。
destoy済みのobjectをbelongs_to associationに指定した場合のテストを追加しています。
Update 'rails_welcome.png' to reflect a more diverse population (#32735)
guides/assets/images/getting_started/rails_welcome.png
の修正です。
元々白人(と思われる人)しかいなかったのを、より多様な人種がいる画像に更新しています。
Merge pull request #32617 from tgturner/size-should-use-available-association
activerecord/lib/active_record/associations/collection_association.rb
の修正です。
Associations::CollectionAssociation#size
、及び、Associations::CollectionAssociation#empty?
メソッドでassociation idsがload済みだった場合、queryを実行せず、そのload済みのidsを使用するよう修正しています。
Ensure that ids_reader
respects dirty target whether target is loaded or not
activerecord/lib/active_record/associations/collection_association.rb
の修正です。
ids_reader
メソッドで、targetがロード済みかどうかに関わらず、dirty targetを使用するよう修正しています。collection.size
と挙動を合わせる為。