method
process_arguments
rails latest stable - Class:
ActiveRecord::Encryption::ExtendedDeterministicQueries::EncryptedQuery
process_arguments(owner, args, check_for_additional_values)public
No documentation available.
# File activerecord/lib/active_record/encryption/extended_deterministic_queries.rb, line 43
def process_arguments(owner, args, check_for_additional_values)
return args if owner.deterministic_encrypted_attributes&.empty?
if args.is_a?(Array) && (options = args.first).is_a?(Hash)
options = options.transform_keys do |key|
if key.is_a?(Array)
key.map(&:to_s)
else
key.to_s
end
end
args[0] = options
owner.deterministic_encrypted_attributes&.each do |attribute_name|
attribute_name = attribute_name.to_s
type = owner.type_for_attribute(attribute_name)
if !type.previous_types.empty? && value = options[attribute_name]
options[attribute_name] = process_encrypted_query_argument(value, check_for_additional_values, type)
end
end
end
args
end