corm 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/corm/model.rb +6 -0
- metadata +2 -2
data/lib/corm/model.rb
CHANGED
@@ -118,6 +118,12 @@ module Corm
|
|
118
118
|
class_variable_get :@@keyspace
|
119
119
|
end
|
120
120
|
|
121
|
+
def self.keyspace!(replication = nil, durable_writes = true)
|
122
|
+
replication ||= "{'class': 'SimpleStrategy', 'replication_factor': '1'}"
|
123
|
+
statement = "CREATE KEYSPACE #{keyspace} WITH replication = #{replication} AND durable_writes = #{durable_writes};"
|
124
|
+
cluster.connect.execute statement
|
125
|
+
end
|
126
|
+
|
121
127
|
def self.primary_key partition_key = nil, *cols
|
122
128
|
class_variable_set :@@primary_key, [Array(partition_key), cols] unless partition_key.nil?
|
123
129
|
class_variable_get :@@primary_key
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-03-
|
12
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cassandra-driver
|