Sha256: 36f8a0a193f4390c459720a1705c04701c87b11a491acdacf49392aa85b815b7
Contents?: true
Size: 920 Bytes
Versions: 2
Compression:
Stored size: 920 Bytes
Contents
require "binary_serializer" class Person < ActiveRecord::Base include Vault::EncryptedModel vault_attribute :ssn vault_attribute :credit_card, encrypted_column: :cc_encrypted, path: "credit-secrets", key: "people_credit_cards" vault_attribute :details, serialize: :json vault_attribute :business_card, serialize: BinarySerializer vault_attribute :favorite_color, encode: ->(raw) { "xxx#{raw}xxx" }, decode: ->(raw) { raw && raw[3...-3] } vault_attribute :non_ascii vault_attribute :default, default: "abc123" vault_attribute :default_with_serializer, serialize: :json, default: {} vault_attribute :context_string, context: "production" vault_attribute :context_symbol, context: :encryption_context vault_attribute :context_proc, context: ->(record) { record.encryption_context } def encryption_context "user_#{id}" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vault-rails-0.6.0 | spec/dummy/app/models/person.rb |
vault-rails-0.5.0 | spec/dummy/app/models/person.rb |