Method: ActiveRecord::Encryption::Cipher#encrypt
- Defined in:
- activerecord/lib/active_record/encryption/cipher.rb
#encrypt(clean_text, key:, deterministic: false) ⇒ Object
Encrypts the provided text and return an encrypted Message.
15 16 17 18 19 |
# File 'activerecord/lib/active_record/encryption/cipher.rb', line 15 def encrypt(clean_text, key:, deterministic: false) cipher_for(key, deterministic: deterministic).encrypt(clean_text).tap do || .headers.encoding = clean_text.encoding.name unless clean_text.encoding == DEFAULT_ENCODING end end |