redcord 0.1.4 → 0.1.5

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: 134041206308ab5d1cb967dca5b5985b2bdd6b9c058601d7040d75d1119a2c98
4
- data.tar.gz: d04f590786ab4cd9251ac32f5eea7d11e8103c448916c4aaee290db177370eca
3
+ metadata.gz: bf6ea43c415c480fb7b3484deb69005c13f52bb644fef52f5570d078b15baf46
4
+ data.tar.gz: 0ae55fe438326a9fac46364e6ca0652d71da69aadae9dd204477f1ef502211fc
5
5
  SHA512:
6
- metadata.gz: 374deab010a1f6b40e038adae19b4a7dee5485c5e17ff3a7e8fc92a4e839a2e9835166acd9b6369e7b628e206c1a280e943a28c040172d107c147d3be158fa8b
7
- data.tar.gz: 28279ab008fcf6ba226d574250f882f35b05b69fc968794430c3d992c69fd686ec9c2f3fa7821aa6227426c7a027fda07c6e929624a533058c4a396c975f1140
6
+ metadata.gz: 5f45e3e9bb1c575051df21af680a817bff3a1bb2a367adba95258ab23535cb0fb08d024008edfdd16c58e4132bf67037e7f8bb8ce947e494323ef23a33e4ab1a
7
+ data.tar.gz: d99aa9db0fec8580aacb6fa066612b6cc39c4028fb5a2af4c3c2bc03e851c1bdfa58a2eb17c121e148fef171a1913ed5086e4a2abc877fa47149aa701b260092
@@ -37,7 +37,7 @@ module Redcord::Attribute
37
37
  klass.include(InstanceMethods)
38
38
  klass.class_variable_set(:@@index_attributes, Set.new)
39
39
  klass.class_variable_set(:@@range_index_attributes, Set.new)
40
- klass.class_variable_set(:@@custom_index_attributes, Hash.new { |h, k| h[k] = [] })
40
+ klass.class_variable_set(:@@custom_index_attributes, Hash.new)
41
41
  klass.class_variable_set(:@@ttl, nil)
42
42
  klass.class_variable_set(:@@shard_by_attribute, nil)
43
43
  end
@@ -99,7 +99,7 @@ class Redcord::Relation
99
99
  extract_query_conditions!,
100
100
  index_attrs: model._script_arg_index_attrs,
101
101
  range_index_attrs: model._script_arg_range_index_attrs,
102
- custom_index_attrs: model._script_arg_custom_index_attrs[custom_index_name],
102
+ custom_index_attrs: model._script_arg_custom_index_attrs[custom_index_name] || [],
103
103
  hash_tag: extract_hash_tag!,
104
104
  custom_index_name: custom_index_name
105
105
  )
@@ -223,7 +223,7 @@ class Redcord::Relation
223
223
  select_attrs: select_attrs,
224
224
  index_attrs: model._script_arg_index_attrs,
225
225
  range_index_attrs: model._script_arg_range_index_attrs,
226
- custom_index_attrs: model._script_arg_custom_index_attrs[custom_index_name],
226
+ custom_index_attrs: model._script_arg_custom_index_attrs[custom_index_name] || [],
227
227
  hash_tag: extract_hash_tag!,
228
228
  custom_index_name: custom_index_name
229
229
  )
@@ -239,7 +239,7 @@ class Redcord::Relation
239
239
  extract_query_conditions!,
240
240
  index_attrs: model._script_arg_index_attrs,
241
241
  range_index_attrs: model._script_arg_range_index_attrs,
242
- custom_index_attrs: model._script_arg_custom_index_attrs[custom_index_name],
242
+ custom_index_attrs: model._script_arg_custom_index_attrs[custom_index_name] || [],
243
243
  hash_tag: extract_hash_tag!,
244
244
  custom_index_name: custom_index_name
245
245
  )
@@ -81,7 +81,7 @@ module Redcord::Serializer
81
81
  attr_keys.each do |attr_key|
82
82
  next if attr_key == shard_by_attribute
83
83
 
84
- if !custom_index_attributes.empty?
84
+ if !custom_index_attributes.nil? && !custom_index_attributes.empty?
85
85
  if !custom_index_attributes.include?(attr_key)
86
86
  raise(
87
87
  Redcord::AttributeNotIndexed,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redcord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chan Zuckerberg Initiative