Skip to content

0.0.5

Latest

Choose a tag to compare

@katafrakt katafrakt released this 09 Sep 19:55
63e5016
  • Support for nil/NULL values in encrypted columns.
  • New support_unencrypted_data option, 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