Module: ActiveRecord::Encryption::ExtendedDeterministicQueries::InWithAdditionalValues

Defined in:
activerecord/lib/active_record/encryption/extended_deterministic_queries.rb

Instance Method Summary collapse

Instance Method Details

#encryption_aware_type_casterObject


150
151
152
153
154
155
156
# File 'activerecord/lib/active_record/encryption/extended_deterministic_queries.rb', line 150

def encryption_aware_type_caster
  if attribute.type_caster.is_a?(ActiveRecord::Encryption::EncryptedAttributeType)
    attribute.type_caster.cast_type
  else
    attribute.type_caster
  end
end

#proc_for_bindsObject


146
147
148
# File 'activerecord/lib/active_record/encryption/extended_deterministic_queries.rb', line 146

def proc_for_binds
  -> value { ActiveModel::Attribute.with_cast_value(attribute.name, value, encryption_aware_type_caster) }
end