Class: EncryptedText

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/encrypted_text.rb

Instance Method Summary collapse

Instance Method Details

#encrypt_valueObject



16
17
18
# File 'app/models/encrypted_text.rb', line 16

def encrypt_value
  self.value = AppyantraAdmin::Crypto.encrypt_to_base64(self.value)
end

#entity_valueObject



7
8
9
# File 'app/models/encrypted_text.rb', line 7

def entity_value
  AppyantraAdmin::Crypto.decrypt_from_base64(self.value)
end

#entity_value=(value) ⇒ Object



11
12
13
14
# File 'app/models/encrypted_text.rb', line 11

def entity_value=(value)
  self.value = value
  self.save
end