remodel 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -188,7 +188,8 @@ module Remodel
188
188
  result = {}
189
189
  attributes.each do |name, value|
190
190
  short = shortname[name] || name
191
- result[short] = mapper[name].pack(value)
191
+ value = mapper[name].pack(value)
192
+ result[short] = value unless value.nil?
192
193
  end
193
194
  result
194
195
  end
data/test/test_entity.rb CHANGED
@@ -97,6 +97,14 @@ class TestEntity < Test::Unit::TestCase
97
97
  assert_equal 'hello', foo.x
98
98
  assert_equal false, foo.y
99
99
  end
100
+
101
+ should "not store nil values" do
102
+ foo = Foo.new(context, :x => nil, :y => false)
103
+ foo.save
104
+ foo.reload
105
+ assert_nil foo.x
106
+ assert_equal '{"y":false}', redis.hget(context.key, foo.key)
107
+ end
100
108
  end
101
109
 
102
110
  context "reload" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 1
9
- version: 0.4.1
8
+ - 2
9
+ version: 0.4.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tim Lossen
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-07-26 00:00:00 +02:00
17
+ date: 2011-08-11 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20