Repository navigation
- Support for
nil/NULLvalues in encrypted columns. - New
support_unencrypted_dataoption, defaulting to false. If the database, for whatever reason, contains plaintext values, starting from this version it will result in an exception. However, if you want to support this behaviour, most likely due to legacy database, you can opt in to reading the plaintext values too.
NOTE: this requires a monkey patch for non-PostgreSQL databases. It's because of a bug in rom-sql. You have to "install" this monkey patch directly, using:
require "rom/encrypted_attribute/rom_sql_patch"
ROM::SQL::Patch432.install!Then you can use the option for example in a ROM plugin:
class SecretNotes < ::ROM::Relation[:sql]
schema(:secret_notes, infer: true) do
use :encrypted_attributes
encrypt :content, support_unencrypted_data: true
end
end