なるようになるブログ

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

rails commit log流し読み(2018/08/05)

2018/08/05分のコミットです。

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

activesupport/CHANGELOG.md


Merge pull request #33511 from albertoalmagro/change-references-from-rake-to-rails-command

各種コマンドについて説明している箇所で、説明にrake taskを使用しているのをrails commandを使用するよう修正しています。


Merge pull request #33454 from azbshiri/extend-affects-nested-attributes

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

associationにextendオプションでmoduleを指定している + accepts_nested_attributes_forを使用している場合に、<association>_attributesメソッドでassocationをbuildした際にextendオプションで指定したmoduleのメソッドがよばれないバグがあったのを修正しています。


Support skip nil for cache fetch (#25437)

activesupport/lib/active_support/cache.rbの修正です。

ActiveSupport::Cache#fetchメソッドにskip_nilオプションを追加しています。skip_nilオプションにtrueを指定した場合、結果がnilの場合は値をキャッシュしないようになっています。

cache.fetch('foo') { nil }
cache.fetch('bar', skip_nil: true) { nil }

cache.exist?('foo') # => true
cache.exist?('bar') # => false