Method: Sequel::Plugins::ColumnEncryption::DatasetMethods#needing_reencryption

Defined in:
lib/sequel/plugins/column_encryption.rb

#needing_reencryptionObject

Filter the dataset to exclude rows where all encrypted columns are already encrypted with the current key and format.



738
739
740
741
742
743
744
745
# File 'lib/sequel/plugins/column_encryption.rb', line 738

def needing_reencryption
  incorrect_column_prefixes = model.send(:column_encryption_metadata).map do |column, |
    prefix = .key_searcher.call
    (Sequel[column] < prefix) | (Sequel[column] > prefix + 'B')
  end

  where(Sequel.|(*incorrect_column_prefixes))
end