sessionm-cassandra_object 2.3.8 → 2.3.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,24 @@ module CassandraObject
13
13
  end
14
14
  end
15
15
 
16
+ def add_multiple_columns(key, hash, options = {})
17
+ columns = hash.keys
18
+ values = []
19
+ if ! columns.empty? && hash[columns.first].is_a?(Hash)
20
+ column_spec = hash.map { |column, sub_columns| sub_columns.keys.map { |sub_column| [column, sub_column].join('.') } }.flatten.join(', ')
21
+ values = hash.map { |column, sub_columns| sub_columns.values }.flatten
22
+ else
23
+ column_spec = columns.join(', ')
24
+ values = hash.values
25
+ end
26
+ values.uniq!
27
+ value_spec = values.length == 1 ? values[0] : '<various>'
28
+
29
+ ActiveSupport::Notifications.instrument("add.cassandra_object", column_family: column_family, key: key, column: column_spec, value: value_spec) do
30
+ connection.add_multiple_columns(column_family, key, hash, :consistency => thrift_write_consistency)
31
+ end
32
+ end
33
+
16
34
  def remove(key)
17
35
  ActiveSupport::Notifications.instrument("remove.cassandra_object", column_family: column_family, key: key) do
18
36
  connection.remove(column_family, key.to_s, consistency: thrift_write_consistency)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sessionm-cassandra_object'
5
- s.version = '2.3.8'
5
+ s.version = '2.3.9'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ['lib']
20
20
 
21
21
  s.add_runtime_dependency('rails', "~> 3.0.9")
22
- s.add_runtime_dependency('cassandra', ">= 0.11.3")
22
+ s.add_runtime_dependency('sessionm-cassandra', ">= 1.0.0")
23
23
 
24
24
  s.add_development_dependency('bundler', ">= 1.0.0")
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sessionm-cassandra_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.8
4
+ version: 2.3.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-03-27 00:00:00.000000000 Z
14
+ date: 2013-04-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -30,13 +30,13 @@ dependencies:
30
30
  - !ruby/object:Gem::Version
31
31
  version: 3.0.9
32
32
  - !ruby/object:Gem::Dependency
33
- name: cassandra
33
+ name: sessionm-cassandra
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  none: false
36
36
  requirements:
37
37
  - - ! '>='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.11.3
39
+ version: 1.0.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  requirements:
45
45
  - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.11.3
47
+ version: 1.0.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: bundler
50
50
  requirement: !ruby/object:Gem::Requirement