method

encrypt_fixture_data

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: EncryptedFixtures
encrypt_fixture_data(fixture, model_class) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/encryption/encrypted_fixtures.rb, line 14
        def encrypt_fixture_data(fixture, model_class)
          model_class&.encrypted_attributes&.each do |attribute_name|
            if clean_value = fixture[attribute_name.to_s]
              @clean_values[attribute_name.to_s] = clean_value

              type = model_class.type_for_attribute(attribute_name)
              encrypted_value = type.serialize(clean_value)
              fixture[attribute_name.to_s] = encrypted_value
            end
          end
        end
Register or log in to add new notes.