instance method
encrypt
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
encrypt(model_class, attribute_name, clean_value)
No documentation comment.
Parameters
-
model_classreq -
attribute_namereq -
clean_valuereq
Source
# File activerecord/lib/active_record/encryption/encrypted_fixtures.rb, line 32
def encrypt(model_class, attribute_name, clean_value)
encrypted_value = model_class.type_for_attribute(attribute_name).serialize(clean_value)
if column = model_class.columns_hash[attribute_name.to_s]
column.cast_type.deserialize(encrypted_value)
else
encrypted_value
end
end
Defined in activerecord/lib/active_record/encryption/encrypted_fixtures.rb line 32
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Encryption::EncryptedFixtures