cassandra_mocks 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cassandra_mocks/table.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 623443785dfffb8a20250c09068ea3b80c8d1c00
|
4
|
+
data.tar.gz: e0d116e27c72bf7cb4908f48f54140885e6da765
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a50d7e3a7fa27076eb478be32e485219b50b50625208d499ad5c1212ff9d09c4988e84408acedf4152efcbb304785562de82fd059107de71bf7a7fa79beb08f
|
7
|
+
data.tar.gz: 93c13f748a7c60267604ac6beb2a38b379a64e8c91050f1c581a977408d22995625c1a32cc0d6b3387aca8de7c855c3f67a6f13713ce3f9028cfabcb832fd644
|
@@ -33,6 +33,7 @@ module Cassandra
|
|
33
33
|
unless filter.empty?
|
34
34
|
validate_partion_key_filter!(filter)
|
35
35
|
validate_clustering_column_filter!(filter)
|
36
|
+
raise_if_fields_restricted!(filter)
|
36
37
|
end
|
37
38
|
|
38
39
|
filtered_rows = filtered_rows(filter)
|
@@ -135,6 +136,11 @@ module Cassandra
|
|
135
136
|
end
|
136
137
|
end
|
137
138
|
|
139
|
+
def raise_if_fields_restricted!(filter)
|
140
|
+
fields = column_names - (partition_key_names + clustering_key_names)
|
141
|
+
raise Cassandra::Errors::InvalidError.new('Filtering by fields is not supported', 'MockStatement') if fields.any? { |field| filter.keys.include?(field) }
|
142
|
+
end
|
143
|
+
|
138
144
|
def filter_has_column?(filter, column)
|
139
145
|
filter[column]
|
140
146
|
end
|