relix 2.3.1 → 2.3.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
  SHA1:
3
- metadata.gz: e8d8f7b558a7f1f95ecee7738999e5f626ea919e
4
- data.tar.gz: 2eba394838de84343e31a8a53a118658f0aa0817
3
+ metadata.gz: a05e8c67fc3744926111a13579f71d5f9c667527
4
+ data.tar.gz: 7c01d06f773737fb4b696d23c561131ca5f679ca
5
5
  SHA512:
6
- metadata.gz: 7fa83e0295997192e0e10b76969a476743698027a3543e7bbe9b03d4d0318bf5f6a360ee9ed11d043f79dc32c3782ad82e495728e6c111296cc785376b3d8d2e
7
- data.tar.gz: e385c1bed5f4b4d428d5e701562fe962eda879d8c346ba04bc50a0652a974811b9999b3a9acffee09a917775f3340999daafe1eea024d8db9d21204871f4e70e
6
+ metadata.gz: a5ef9a8f8a69734071d709e940f2fb644d19c7f59a686390a18148c093eabfe7f0e2626377d195c911993bd501e17e8fadcc0010f8c167ef0f50b58faffdf6ed
7
+ data.tar.gz: 3301697337164bff88312f504aca6f46389810872fd6545769172ba45ced689c5cd520acfd5824dead203f75573bd841ec7231f67cf0ec014e1691ccb8ab4073
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 2.3.2
2
+
3
+ * Make uniqueness check more robust (ntalbott)
4
+
1
5
  ### 2.3.1
2
6
 
3
7
  * Fix current_values not being written out (ntalbott)
@@ -74,7 +74,7 @@ module Relix
74
74
  nil
75
75
  end
76
76
 
77
- def filter(r, object, value)
77
+ def filter(r, pk, object, value)
78
78
  true
79
79
  end
80
80
 
@@ -140,7 +140,7 @@ module Relix
140
140
  if index.index?(redis, object, value)
141
141
  new_current_values[name] = value unless index.attribute_immutable?
142
142
  next if value == old_value
143
- next unless index.filter(redis, object, value)
143
+ next unless index.filter(redis, pk, object, value)
144
144
 
145
145
  query_value = index.query(redis, value)
146
146
  proc do
@@ -11,7 +11,7 @@ module Relix
11
11
  name
12
12
  end
13
13
 
14
- def filter(r, object, value)
14
+ def filter(r, pk, object, value)
15
15
  !r.zscore(name, value)
16
16
  end
17
17
 
@@ -14,8 +14,9 @@ module Relix
14
14
  hash_name
15
15
  end
16
16
 
17
- def filter(r, object, value)
18
- if r.hexists(hash_name, value)
17
+ def filter(r, pk, object, value)
18
+ v = r.hget(hash_name, value)
19
+ if(v && (v != pk))
19
20
  raise NotUniqueError.new("'#{value}' is not unique in index #{name}")
20
21
  end
21
22
  super
@@ -1,5 +1,5 @@
1
1
  module Relix
2
- VERSION = "2.3.1"
2
+ VERSION = "2.3.2"
3
3
  REDIS_VERSION = "2.6"
4
4
 
5
5
  class Version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relix
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel Talbott