sdb_dal 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sdb_dal/domain_object.rb +13 -6
  2. metadata +2 -2
@@ -21,17 +21,24 @@ module SdbDal
21
21
 
22
22
  end
23
23
 
24
+
24
25
  def copy_attributes(hash)
25
26
  self.class.attribute_descriptions.each do |attribute_name,description|
26
- value=hash[attribute_name]
27
- value=value || hash[attribute_name.intern]
28
- if !description.is_collection && value.respond_to?(:flatten) && value.length==1
29
- value=value[0]
30
- end
31
- @attribute_values[attribute_name]=value
27
+ if hash.has_key?(attribute_name) or hash.has_key?(attribute_name.intern)
28
+ value=hash[attribute_name]
29
+ value=value || hash[attribute_name.intern]
30
+ if !description.is_collection && value.respond_to?(:flatten) && value.length==1
31
+ value=value[0]
32
+ end
33
+ @attribute_values[attribute_name]=value
34
+ else
35
+ @attribute_values[attribute_name]=nil unless @attribute_values.has_key?(attribute_name)
36
+ end
37
+
32
38
 
33
39
  end
34
40
 
41
+
35
42
  end
36
43
 
37
44
  def self.primary_key_attribute_names
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdb_dal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Knight
@@ -9,7 +9,7 @@ autorequire: sdb_dal
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-23 00:00:00 -08:00
12
+ date: 2009-02-02 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15