Class: Encrypt

Inherits:
Object
  • Object
show all
Defined in:
lib/encrypt_column/encrypt.rb

Class Method Summary collapse

Class Method Details

.text(plaintext) ⇒ Object



2
3
4
5
# File 'lib/encrypt_column/encrypt.rb', line 2

def self.text(plaintext)
  return raise 'Missing Encryption Key Config' if ENV['ENCRYPTION_KEY'].nil?
  ActiveSupport::MessageEncryptor.new(ENV['ENCRYPTION_KEY']).encrypt_and_sign(plaintext)
end