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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cassandra_mocks/table.rb +6 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cb523dc3b2869ceefd46de81df08a5d365973e6
4
- data.tar.gz: 82f0c845610d71441cc384c67707d18f2bc852a9
3
+ metadata.gz: 623443785dfffb8a20250c09068ea3b80c8d1c00
4
+ data.tar.gz: e0d116e27c72bf7cb4908f48f54140885e6da765
5
5
  SHA512:
6
- metadata.gz: 2a3068c7b8d64745076d5d868e30f5943ed09c48d51f1f7cff8184de3f41eaea6b48c5f0c12bdb86b2f7ddda7ed1a78b83eabd64d1d6e9d868b87572a41de22e
7
- data.tar.gz: f15557480a35b6434e3793b387ec952abbe291ccc34e11d65e584a3580e742c4e30bd68a0801f64cd3dd896859ed47c60f642ec910984d20adad2315069c058e
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassandra_mocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas RM Rogers