instance method encrypt_fixture_data

Ruby on Rails 7.1.6

Since v7.0.10 Private

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

encrypt_fixture_data(fixture, model_class)

No documentation comment.

Parameters

fixture req
model_class req
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

Defined in activerecord/lib/active_record/encryption/encrypted_fixtures.rb line 14 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Encryption::EncryptedFixtures

Type at least 2 characters to search.

↑↓ navigate · open · esc close