Revision 977f12ed
Added by Amir Fefer about 8 years ago
app/models/concerns/enc_output.rb | ||
---|---|---|
def to_enc
|
||
own_attributes = {}
|
||
self.attributes.each do |k, v|
|
||
v = decrypt_field(v) if self.is_a?(Encryptable) && is_decryptable?(v)
|
||
own_attributes[k] = primitive_value(transform(k, v)) if enc_attributes.include?(k.to_s)
|
||
end
|
||
own_associations = embed_associations.map { |a| [a, self.send(a).try(:to_enc)] }
|
Also available in: Unified diff
Fixes #1329 - encrypt BMC password in DB