instance method encrypt

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

encrypt(model_class, attribute_name, clean_value)

No documentation comment.

Parameters

model_class req
attribute_name req
clean_value req
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

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close