active_redis_orm 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b411bfb8f667027da1b252715b2558fb963a2a8
4
- data.tar.gz: 55692c9536d1fbeb6be3ed325785f487f2c97c16
3
+ metadata.gz: 835629f57538a971822d8594eb11be972232c5d1
4
+ data.tar.gz: 417ff294268b204aa1e2f22d865a36de727fd1bc
5
5
  SHA512:
6
- metadata.gz: e22e86f443f986590ab0e9bc155d8d9c0d414fb0c1f958f3fe4440ede5141b18f09d44fc4dacba6fd34b8d2f7a48ef8d472a861b7555dbe4acda9e02e796ac59
7
- data.tar.gz: 29fc748ea40c80f9f2f0d792fcbec6ba408d7a730bce41239159aa6df172134ed92a133a53959af7ac44e784599eaf2a635c133386ceb617502ad9b86a2129ff
6
+ metadata.gz: d8dc8e27c8638a909e9d0c5157c6e6835735fa8db5d92a8211e5ef01a43c31668bd34c19ba0465a5c8713c8f5508c88cc7ddc71f89ae5361a90ba2c8935a5951
7
+ data.tar.gz: 4f9d501a9a4516a9fcfe2ddba2402e6c28dd32e1df17a1e865b231c26bbe82e9aa2ee64b9d95e626e02d59582992b829128f02878238b45c8d09bbf74c34a334
@@ -19,5 +19,9 @@ module ActiveRedis
19
19
  def to_s
20
20
  ""
21
21
  end
22
+
23
+ def to_i
24
+ 0
25
+ end
22
26
  end
23
27
  end
@@ -29,7 +29,11 @@ module ActiveRedis
29
29
  run_callbacks :save do
30
30
  Redis.current.pipelined do
31
31
  self.changes.each do |key, value|
32
- send("set_#{key}", value)
32
+ if value.last.nil?
33
+ send("#{key}_object").delete
34
+ else
35
+ send("set_#{key}", value)
36
+ end
33
37
  end
34
38
  end
35
39
  @new_record = false
@@ -1,3 +1,3 @@
1
1
  module ActiveRedis
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -56,6 +56,14 @@ describe ActiveRedis do
56
56
  object.save
57
57
  Redis.current.get("#{ActiveRedisObject.redis_namespace}:#{id}:foo").should == "I am foo"
58
58
  end
59
+
60
+ it "nullifies stuff" do
61
+ object = ActiveRedisObject.create(date: Date.today)
62
+ object.date = nil
63
+ object.save
64
+ object.reload!
65
+ object.date_object.value.should be_nil
66
+ end
59
67
  end
60
68
 
61
69
  context "setters" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_redis_orm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Caspy