gotime-cassandra_object 2.7.6 → 2.7.7

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 = '2.7.6'
5
+ s.version = '2.7.7'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
 
@@ -8,9 +8,9 @@ module CassandraObject
8
8
  end
9
9
 
10
10
  def instantiate(record, value)
11
- value ||= coder.default
11
+ value = value.nil? ? coder.default : value
12
12
  return unless value
13
-
13
+
14
14
  value = value.kind_of?(String) ? coder.decode(value) : value
15
15
  coder.wrap(record, name, value)
16
16
  end
@@ -26,7 +26,7 @@ class CassandraObject::AttributeMethods::DirtyTest < CassandraObject::TestCase
26
26
  assert !record.changed?
27
27
  end
28
28
 
29
- test 'typecase before dirty check' do
29
+ test 'typecast float before dirty check' do
30
30
  record = temp_object do
31
31
  float :price
32
32
  end.create(price: 5.01)
@@ -37,4 +37,18 @@ class CassandraObject::AttributeMethods::DirtyTest < CassandraObject::TestCase
37
37
  record.price = '7.12'
38
38
  assert record.changed?
39
39
  end
40
+
41
+ test 'boolean' do
42
+ record = temp_object do
43
+ boolean :awesome
44
+ end.create(awesome: false)
45
+
46
+ p record.changes
47
+
48
+ record.awesome = false
49
+ assert !record.changed?
50
+
51
+ record.awesome = true
52
+ assert record.changed?
53
+ end
40
54
  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: 2.7.6
4
+ version: 2.7.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-09-07 00:00:00.000000000Z
13
+ date: 2011-09-08 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
17
- requirement: &70215086256320 !ruby/object:Gem::Requirement
17
+ requirement: &70307311712600 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70215086256320
25
+ version_requirements: *70307311712600
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: cassandra
28
- requirement: &70215086255600 !ruby/object:Gem::Requirement
28
+ requirement: &70307311712080 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.12.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70215086255600
36
+ version_requirements: *70307311712080
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &70215086254540 !ruby/object:Gem::Requirement
39
+ requirement: &70307311711600 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: 1.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70215086254540
47
+ version_requirements: *70307311711600
48
48
  description: Cassandra ActiveModel
49
49
  email: gems@gotime.com
50
50
  executables: []