dynameek 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/lib/dynameek/model/dynamo_db.rb +1 -0
- data/lib/dynameek/model.rb +1 -1
- data/lib/dynameek/version.rb +1 -1
- data/test/spec/simple_spec.rb +12 -0
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/lib/dynameek/model.rb
CHANGED
@@ -10,7 +10,7 @@ module Dynameek
|
|
10
10
|
#Note that this is required for the multicolumn key
|
11
11
|
val = self.send field
|
12
12
|
val = self.class.convert_to_dynamodb(type, val)
|
13
|
-
memo[field] = val
|
13
|
+
memo[field] = val unless val.nil?
|
14
14
|
memo
|
15
15
|
end
|
16
16
|
self.class.before_save_callbacks.each{|method| self.send method}
|
data/lib/dynameek/version.rb
CHANGED
data/test/spec/simple_spec.rb
CHANGED
@@ -19,6 +19,18 @@ describe Simple do
|
|
19
19
|
con = Simple.find(1)
|
20
20
|
con.binary_value[:hello].should == :sup
|
21
21
|
end
|
22
|
+
|
23
|
+
it "should ingore nils" do
|
24
|
+
con = nil
|
25
|
+
lambda{
|
26
|
+
con = Simple.create(:my_id => 1, :some_value => "sup", :binary_value => nil)
|
27
|
+
}.should_not raise_error
|
28
|
+
con.hash_key.should == 1
|
29
|
+
con.some_value.should == "sup"
|
30
|
+
con = Simple.find(1)
|
31
|
+
con.binary_value.should be_nil
|
32
|
+
end
|
33
|
+
|
22
34
|
it "should allow you to store binary data removing default_proc" do
|
23
35
|
con = nil
|
24
36
|
hsh = Hash.new{|h, k| h[k] = :a}
|