2023/07/27分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Active Support cache stores now support replacing the default compressor via a
:compressor
option. The specified compressor must respond todeflate
andinflate
. - Active Support cache stores now support a
:serializer
option. Similar to the:coder
option, serializers must respond todump
andload
. However, serializers are only responsible for serializing a cached value, whereas coders are responsible for serializing the entireActiveSupport::Cache::Entry
instance. - Make all cache stores return a boolean for
#delete
Support replacing cache compressor
Active Supportの修正です。
cache storeで使用するcompressorに任意のクラスを使用出来るよう修正しています。 compressor用のクラスはdeflate
とinflate
メソッドを実装する必要があり、:compressor
オプションにそのクラスを指定する事で使用出来るようになっています。
module MyCompressor def self.deflate(string) compression logic... end def self.inflate(compressed) # decompression logic... end end config.cache_store = :redis_cache_store, { compressor: MyCompressor }
合わせて、cache storeで使用するserializerを:serializer
オプションで指定出来るよう修正しています。こちらはdump
とload
メソッドが実装されている必要があります。
Added test for --no-skip-docker command line argument
railties/test/generators/app_generator_test.rb
の修正です。
rails new
に--no-skip-docker
オプションを指定した場合のテストを追加しています。
Merge pull request #48817 from Shopify/return-false-early-if-non-AR-value-passed-in-include
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
FinderMethods#include?
にActive Recordのobjectではない不正な値が指定された場合にNoMethodError
が発生してしまうバグがあったのを修正しています。
Make all cache stores return a boolean for #delete
Active Supportの修正です。
cache storeによって#delete
の戻り値が異なっていた(例えばredis cache storeは0
/1
を返していたが、fire storeはnil
/false
を返していた)のを、delete対象のkeyが見つかった場合はtrue
を、そうでない場合はfalse
を返すよう全てのstoreで挙動を統一するよう修正しています。
Fix a rebase mistake in activesupport/CHANGELOG
activesupport/CHANGELOG.md
の修正です。
rebaseミスによりエントリーの対応者が消えてしまっていたのを修正しています。
Remove an extra whitespace in activesupport/CHANGELOG
activesupport/CHANGELOG.md
の修正です。
不要な空白を削除しています。
Sort SchemaCache members when dumping it
activerecord/lib/active_record/connection_adapters/schema_cache.rb
の修正です。
SchemaCacheでcolumns
やprimary_keys
を出力する際に値をsortしてから出力するよう修正しています。出力結果が毎回同じになるようにする為。