cequel 0.4.1 → 0.4.2
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.
- data/lib/cequel/keyspace.rb +1 -1
- data/lib/cequel/model/dictionary.rb +9 -2
- data/lib/cequel/version.rb +1 -1
- metadata +2 -2
data/lib/cequel/keyspace.rb
CHANGED
@@ -17,7 +17,7 @@ module Cequel
|
|
17
17
|
def initialize(configuration = {})
|
18
18
|
@name = configuration[:keyspace]
|
19
19
|
@hosts = configuration[:host] || configuration[:hosts]
|
20
|
-
@thrift_options = configuration[:thrift].try(:symbolize_keys)
|
20
|
+
@thrift_options = configuration[:thrift].try(:symbolize_keys) || {}
|
21
21
|
end
|
22
22
|
|
23
23
|
def connection
|
@@ -97,14 +97,17 @@ module Cequel
|
|
97
97
|
if @loaded
|
98
98
|
@row.slice(*columns)
|
99
99
|
else
|
100
|
-
|
101
|
-
deserialize_row(row).tap do |slice|
|
100
|
+
deserialize_row(load_raw_slice(columns)).tap do |slice|
|
102
101
|
slice.merge!(@row.slice(*columns))
|
103
102
|
@deleted_columns.each { |column| slice.delete(column) }
|
104
103
|
end
|
105
104
|
end
|
106
105
|
end
|
107
106
|
|
107
|
+
def key?(column)
|
108
|
+
@row.key?(column) || load_raw_slice([column])[column].present?
|
109
|
+
end
|
110
|
+
|
108
111
|
def destroy
|
109
112
|
scope.delete
|
110
113
|
setup
|
@@ -208,6 +211,10 @@ module Cequel
|
|
208
211
|
end
|
209
212
|
end
|
210
213
|
|
214
|
+
def load_raw_slice(columns)
|
215
|
+
row = scope.select(*columns).first.except(self.class.key_alias)
|
216
|
+
end
|
217
|
+
|
211
218
|
end
|
212
219
|
|
213
220
|
end
|
data/lib/cequel/version.rb
CHANGED
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: 0.4.
|
4
|
+
version: 0.4.2
|
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: 2012-09-
|
12
|
+
date: 2012-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|