blind_index 2.6.0 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 291577a62790b52028024d748fc849ccaaeebe73b611969291b07a3eef43fd50
4
- data.tar.gz: b0775917f436380ead5163519a98f7984ce257db8b664c44f299f1ebbba32934
3
+ metadata.gz: 3974523e6d9e37b26e94da6e224d073d4da563a9844dfea461b8b96ea1194f7d
4
+ data.tar.gz: c5d0acd3bb4bea2830fcb671ebcb088ef2c44ae44c8284e9ad1f8c3850c840e9
5
5
  SHA512:
6
- metadata.gz: 484dbd052625a14ae883b943d316b3bcf451baf53fb8c67239973c6c7598c50045f3e44af30233424945e427d8e1a43e35dfc3c50884d4567a30d6186cc3aa06
7
- data.tar.gz: fe2ad8af315478d6baa00be6f97bdead8767866a8efa3c334cc1e66898571e6f7407a04ec8b53c4a61657cd23943ec24593559fe8c913f57ea14c82bd3d51c8a
6
+ metadata.gz: 1076b81d8534cf0536a54db04dfa9d402e7a8cc3d85d4d821a8c76e187997f10fc11801908a21841cb38c1a4b371dddb2b89a633863c69799d8f555fbacdecb6
7
+ data.tar.gz: a9ac6a74a631cfa59d5c76fd5782f851d2f2c200e01710b3f445c31ee700abde31fe2efac97cfac2c8596a6d763d2629970f16ba7739a36c4924a83c1aa6547c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.6.2 (2025-02-23)
2
+
3
+ - Fixed querying with normalized attributes
4
+
5
+ ## 2.6.1 (2024-11-01)
6
+
7
+ - Fixed issue with `includes` and Active Record 7
8
+
1
9
  ## 2.6.0 (2024-10-07)
2
10
 
3
11
  - Removed dependency on `scrypt` gem for scrypt algorithm
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
- if value.is_a?(Array)
20
- value.map { |v| BlindIndex.generate_bidx(v, **bi) }
27
+ if value.is_a?(Array) || (defined?(Set) && value.is_a?(Set))
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.0"
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.0
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-10-08 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: []