cequel 3.1.0 → 3.2.0

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
  SHA1:
3
- metadata.gz: 8997183e82dc1c78a6bf30f6abbb311802ff4d37
4
- data.tar.gz: c97d4925764150e9bd7ec574ecc0bc1500752196
3
+ metadata.gz: 06737301a7c04005670f2c38aa69a50d08a8166a
4
+ data.tar.gz: 9253937c264d5d6ef64a3861aa1d909779b9f853
5
5
  SHA512:
6
- metadata.gz: 568edad894b06c8fb5092e7db1c6e5cee98fdb8e06f61c452f769ea5d057895b0075f8e62a916f47bb36edec35e2c3e0f2e3ab894a1256a86c95b3f9cb8b8746
7
- data.tar.gz: 10d23590a90648be41f774ca525ca911d37c63ef4c9d1c54ef1b9102a01318b722dd7c398306254c0819f0874f56afba44456251d301ae012e0c8428ba079260
6
+ metadata.gz: 3e1d63bb14b7f0f7d365533274a54805cce8298c65bb8128715af69338487f41190dda0912ae2980e27a5b021de60d763cc2a697043ef087607ea1071d1776c1
7
+ data.tar.gz: 1c0f57e5b8f3a53624da0a5eb694a4786ab59a362883cf0e3d4296a805947c0106e67310ba8bb5adf6c66cb17fd3ef1b8888b1ea3f9a0bed4c34656327b547b9
@@ -1,3 +1,6 @@
1
+ ## 3.2.0
2
+ - Can filter on more than one non-indexed columns (https://github.com/cequel/cequel/pull/404)
3
+
1
4
  ## 3.1.0
2
5
  - Can now drop columns (https://github.com/cequel/cequel/pull/398)
3
6
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cequel (3.1.0)
4
+ cequel (3.2.0)
5
5
  activemodel (>= 4.0)
6
6
  cassandra-driver (~> 3.0)
7
7
 
data/README.md CHANGED
@@ -150,6 +150,25 @@ module Blogger
150
150
  end
151
151
  ```
152
152
 
153
+ ### Compound Partition Keys ###
154
+
155
+ If you wish to declare a compound partition key in a model, you can do something like:
156
+
157
+ ```ruby
158
+ class Post
159
+ include Cequel::Record
160
+
161
+ key :country, :text, partition: true
162
+ key :blog, :text, partition: true
163
+ key :id, :timeuuid, auto: true
164
+ column :title, :text
165
+ column :body, :text
166
+ end
167
+ ```
168
+
169
+ Your compound partition key here is `(country, blog)`, and the entire compound primary key is `((country, blog), id)`.
170
+ Any key values defined after the last partition key value are clustering columns.
171
+
153
172
  ### Timestamps ###
154
173
 
155
174
  If your final primary key column is a `timeuuid` with the `:auto` option set,
@@ -846,7 +846,7 @@ module Cequel
846
846
  "Can't scope key column #{column_name} without also scoping " \
847
847
  "#{missing_column_names.join(', ')}"
848
848
  end
849
- if scoped_indexed_column
849
+ if scoped_indexed_column && !allow_filtering
850
850
  fail IllegalQuery,
851
851
  "Can't scope by more than one indexed column in the same query"
852
852
  end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Cequel
3
3
  # The current version of the library
4
- VERSION = '3.1.0'
4
+ VERSION = '3.2.0'
5
5
  end
@@ -819,9 +819,16 @@ describe Cequel::Record::RecordSet do
819
819
  end
820
820
 
821
821
  context 'allow_filtering!', cql: '~> 3.4' do
822
- it 'should allow filtering for none indexed columns' do
822
+ it 'should allow filtering for non-indexed columns' do
823
823
  expect(Post.allow_filtering!.where(title: 'Cequel 0').entries.length).to be(1)
824
824
  end
825
+
826
+ it 'should allow filtering for more than one non-indexed column' do
827
+ expect(Post.allow_filtering!.where(
828
+ title: 'Cequel 0',
829
+ body: 'Post number 0'
830
+ ).entries.length).to be(1)
831
+ end
825
832
  end
826
833
  end
827
834
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Brown
@@ -31,7 +31,7 @@ authors:
31
31
  autorequire:
32
32
  bindir: bin
33
33
  cert_chain: []
34
- date: 2018-11-14 00:00:00.000000000 Z
34
+ date: 2019-01-02 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activemodel