なるようになるブログ

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

rails commit log流し読み(2024/07/03)

2024/07/03分のコミットです。

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

activerecord/CHANGELOG.md


Introduce compressor option to ActiveRecord::Encryption::Encryptor

Active Recordの修正です。

ActiveRecord::Encryption::Encryptorで圧縮アルゴリズムに任意のアルゴリズムを指定出来るよう修正しています。デフォルトはZlib(過去のバージョンと同じ)です。アルゴリズムを変更したい場合、encryptscompressorオプションに、deflateinflateメソッドを定義したクラスを指定すればよいようになっています。

module ZstdCompressor
  def self.deflate(data)
    Zstd.compress(data)
  end

  def self.inflate(data)
    Zstd.decompress(data)
  end
end

class User
  encrypts :name, compressor: ZstdCompressor
end

fix newlines

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

メソッド定義の途中で改行を入れている箇所があったのを、メソッド定義は1行で行うよう修正しています。