instance method force_encoding_if_needed

Ruby on Rails 7.2.3

Since v7.0.10 Private

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

Signature

force_encoding_if_needed(value)

No documentation comment.

Parameters

value req
Source
# File activerecord/lib/active_record/encryption/encryptor.rb, line 158
        def force_encoding_if_needed(value)
          if forced_encoding_for_deterministic_encryption && value && value.encoding != forced_encoding_for_deterministic_encryption
            value.encode(forced_encoding_for_deterministic_encryption, invalid: :replace, undef: :replace)
          else
            value
          end
        end

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

Defined in ActiveRecord::Encryption::Encryptor

Type at least 2 characters to search.

↑↓ navigate · open · esc close