instance method
force_encoding_if_needed
Ruby on Rails 7.0.10
Since v7.0.10 PrivateSignature
force_encoding_if_needed(value)
No documentation comment.
Parameters
-
valuereq
Source
# File activerecord/lib/active_record/encryption/encryptor.rb, line 142
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 142
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Encryption::Encryptor