redcord 0.1.4 → 0.1.5
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 +4 -4
- data/lib/redcord/attribute.rb +1 -1
- data/lib/redcord/relation.rb +3 -3
- data/lib/redcord/serializer.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf6ea43c415c480fb7b3484deb69005c13f52bb644fef52f5570d078b15baf46
|
|
4
|
+
data.tar.gz: 0ae55fe438326a9fac46364e6ca0652d71da69aadae9dd204477f1ef502211fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f45e3e9bb1c575051df21af680a817bff3a1bb2a367adba95258ab23535cb0fb08d024008edfdd16c58e4132bf67037e7f8bb8ce947e494323ef23a33e4ab1a
|
|
7
|
+
data.tar.gz: d99aa9db0fec8580aacb6fa066612b6cc39c4028fb5a2af4c3c2bc03e851c1bdfa58a2eb17c121e148fef171a1913ed5086e4a2abc877fa47149aa701b260092
|
data/lib/redcord/attribute.rb
CHANGED
|
@@ -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
|
|
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
|
data/lib/redcord/relation.rb
CHANGED
|
@@ -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
|
)
|
data/lib/redcord/serializer.rb
CHANGED
|
@@ -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,
|