gotime-cassandra_object 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'gotime-cassandra_object'
5
- s.version = '0.8.4'
5
+ s.version = '0.8.5'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
  s.required_rubygems_version = '>= 1.3.5'
@@ -119,14 +119,15 @@ module CassandraObject
119
119
  attributes.inject(Hash.new) do |memo, (column_name, value)|
120
120
  # cassandra stores bytes, not strings, so it has no concept of encodings. The ruby thrift gem
121
121
  # expects all strings to be encoded as ascii-8bit.
122
- memo[column_name.to_s] = model_attributes[column_name].converter.encode(value).force_encoding('ASCII-8BIT')
122
+ # don't attempt to encode columns that are nil
123
+ memo[column_name.to_s] = value.nil? ? value : model_attributes[column_name].converter.encode(value).force_encoding('ASCII-8BIT')
123
124
  memo
124
125
  end.merge({"schema_version" => schema_version.to_s})
125
126
  end
126
127
 
127
128
  def decode_columns_hash(attributes)
128
129
  attributes.inject(Hash.new) do |memo, (column_name, value)|
129
- memo[column_name.to_s] = model_attributes[column_name].converter.decode(value)
130
+ memo[column_name.to_s] = value.nil? ? value : model_attributes[column_name].converter.decode(value)
130
131
  memo
131
132
  end
132
133
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gotime-cassandra_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,12 +10,12 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-03-10 00:00:00.000000000 -08:00
13
+ date: 2011-03-11 00:00:00.000000000 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
18
- requirement: &10878420 !ruby/object:Gem::Requirement
18
+ requirement: &14740120 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '3'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *10878420
26
+ version_requirements: *14740120
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
- requirement: &10877740 !ruby/object:Gem::Requirement
29
+ requirement: &14739420 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: '3'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *10877740
37
+ version_requirements: *14739420
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: cassandra
40
- requirement: &10877160 !ruby/object:Gem::Requirement
40
+ requirement: &14738860 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *10877160
48
+ version_requirements: *14738860
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: shoulda
51
- requirement: &10876480 !ruby/object:Gem::Requirement
51
+ requirement: &14738160 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '0'
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *10876480
59
+ version_requirements: *14738160
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: bundler
62
- requirement: &10875720 !ruby/object:Gem::Requirement
62
+ requirement: &14737420 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: 1.0.0
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *10875720
70
+ version_requirements: *14737420
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: jeweler
73
- requirement: &10874980 !ruby/object:Gem::Requirement
73
+ requirement: &14736660 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ~>
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: 1.5.1
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *10874980
81
+ version_requirements: *14736660
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: rcov
84
- requirement: &10874400 !ruby/object:Gem::Requirement
84
+ requirement: &14736100 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *10874400
92
+ version_requirements: *14736100
93
93
  description: Cassandra ActiveModel
94
94
  email: grantr@gmail.com
95
95
  executables: []