跳至内容 跳至搜索
方法
E
S
W

实例公共方法

exists?(*args)

# File activerecord/lib/active_record/encryption/extended_deterministic_queries.rb, line 102
def exists?(*args)
  super(*EncryptedQuery.process_arguments(self, args, true))
end

scope_for_create()

# File activerecord/lib/active_record/encryption/extended_deterministic_queries.rb, line 106
def scope_for_create
  return super unless model.deterministic_encrypted_attributes&.any?

  scope_attributes = super
  wheres = where_values_hash

  model.deterministic_encrypted_attributes.each do |attribute_name|
    attribute_name = attribute_name.to_s
    values = wheres[attribute_name]
    if values.is_a?(Array) && values[1..].all?(AdditionalValue)
      scope_attributes[attribute_name] = values.first
    end
  end

  scope_attributes
end

where(*args)

# File activerecord/lib/active_record/encryption/extended_deterministic_queries.rb, line 98
def where(*args)
  super(*EncryptedQuery.process_arguments(self, args, true))
end