blind_index 2.6.1 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '029d937b71e363d78763235de48d94c66baf25e11b394ef99d7fc6d72b21f0c8'
4
- data.tar.gz: 6db3c888725fab40d6fae23315ecff70d5cb61ef01972ea9da99346537811233
3
+ metadata.gz: 3974523e6d9e37b26e94da6e224d073d4da563a9844dfea461b8b96ea1194f7d
4
+ data.tar.gz: c5d0acd3bb4bea2830fcb671ebcb088ef2c44ae44c8284e9ad1f8c3850c840e9
5
5
  SHA512:
6
- metadata.gz: 92f8322d3603fa9d419e34fdf2592a08e728405e1dc9a45ac57dbf46715fbb8e34179f03d3948e41617df00b1df93ab07d84cbec364ca058cba4631bff3f2fec
7
- data.tar.gz: f29bd6c7479c52b00650e3c726807ca6dc68a535e2dd9e2fd9cafca7f7a0b4d43cea7f5bff0916896f8750761858f2ec3392af573680274674a1a3cb95293b66
6
+ metadata.gz: 1076b81d8534cf0536a54db04dfa9d402e7a8cc3d85d4d821a8c76e187997f10fc11801908a21841cb38c1a4b371dddb2b89a633863c69799d8f555fbacdecb6
7
+ data.tar.gz: a9ac6a74a631cfa59d5c76fd5782f851d2f2c200e01710b3f445c31ee700abde31fe2efac97cfac2c8596a6d763d2629970f16ba7739a36c4924a83c1aa6547c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.6.2 (2025-02-23)
2
+
3
+ - Fixed querying with normalized attributes
4
+
1
5
  ## 2.6.1 (2024-11-01)
2
6
 
3
7
  - Fixed issue with `includes` and Active Record 7
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2024 Andrew Kane
1
+ Copyright (c) 2017-2025 Andrew Kane
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -14,12 +14,20 @@ module BlindIndex
14
14
  # https://github.com/rails/rails/commit/56f30962b84fc53b76001301fb830c1594fd377e
15
15
  def build(attribute, value, *args)
16
16
  if table.has_blind_indexes? && (bi = table.send(:klass).blind_indexes[attribute.name.to_sym]) && !value.is_a?(ActiveRecord::StatementCache::Substitute)
17
+ model = table.send(:klass)
18
+ attribute_name = attribute.name.to_sym
19
+ cast =
20
+ if model.respond_to?(:normalized_attributes) && model.normalized_attributes.include?(attribute_name)
21
+ ->(v) { model.normalize_value_for(attribute_name, v) }
22
+ else
23
+ ->(v) { v }
24
+ end
17
25
  attribute = attribute.relation[bi[:bidx_attribute]]
18
26
  value =
19
27
  if value.is_a?(Array) || (defined?(Set) && value.is_a?(Set))
20
- value.map { |v| BlindIndex.generate_bidx(v, **bi) }
28
+ value.map { |v| BlindIndex.generate_bidx(cast.call(v), **bi) }
21
29
  else
22
- BlindIndex.generate_bidx(value, **bi)
30
+ BlindIndex.generate_bidx(cast.call(value), **bi)
23
31
  end
24
32
  end
25
33
 
@@ -1,3 +1,3 @@
1
1
  module BlindIndex
2
- VERSION = "2.6.1"
2
+ VERSION = "2.6.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blind_index
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-01 00:00:00.000000000 Z
10
+ date: 2025-02-23 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -38,7 +37,6 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0.2'
41
- description:
42
40
  email: andrew@ankane.org
43
41
  executables: []
44
42
  extensions: []
@@ -58,7 +56,6 @@ homepage: https://github.com/ankane/blind_index
58
56
  licenses:
59
57
  - MIT
60
58
  metadata: {}
61
- post_install_message:
62
59
  rdoc_options: []
63
60
  require_paths:
64
61
  - lib
@@ -73,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
70
  - !ruby/object:Gem::Version
74
71
  version: '0'
75
72
  requirements: []
76
- rubygems_version: 3.5.16
77
- signing_key:
73
+ rubygems_version: 3.6.2
78
74
  specification_version: 4
79
75
  summary: Securely search encrypted database fields
80
76
  test_files: []