dm-xml-adapter 0.577 → 0.578

Sign up to get free protection for your applications and to get access to all the features.
@@ -206,6 +206,8 @@ module DataMapper::Adapters
206
206
  new_obj.instance_variable_set("@#{child.name}", BigDecimal.new(child.content))
207
207
  elsif (child_class == "DateTime")
208
208
  new_obj.instance_variable_set("@#{child.name}", DateTime.parse(child.content))
209
+ elsif (child_class == "Date")
210
+ new_obj.instance_variable_set("@#{child.name}", Date.parse(child.content))
209
211
  end
210
212
  end
211
213
 
@@ -49,6 +49,17 @@ describe DataMapper::Adapters::XmlAdapter do
49
49
  end
50
50
  end
51
51
 
52
+ describe "date" do
53
+ it "should do date" do
54
+ u1 = XMLTest::User.new
55
+ u1.name = "cool!"
56
+ u1.date = Date.parse("01/01/2001")
57
+ u1.save
58
+ u2 = XMLTest::User.first(:name => "cool!")
59
+ u2.date.class.should == Date
60
+ end
61
+ end
62
+
52
63
  describe "boolean" do
53
64
  it "should be boolean" do
54
65
  u1 = XMLTest::User.new
data/spec/spec_helper.rb CHANGED
@@ -45,6 +45,7 @@ class User
45
45
  property :created, DateTime
46
46
  property :cool, Boolean
47
47
  property :content, String
48
+ property :date, Date
48
49
 
49
50
  has n, :posts, :model => "Post"
50
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-xml-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.577"
4
+ version: "0.578"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Harding
@@ -9,7 +9,7 @@ autorequire: dm-xml-adapter
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-18 00:00:00 -04:00
12
+ date: 2010-06-06 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -61,10 +61,10 @@ extensions: []
61
61
  extra_rdoc_files:
62
62
  - README
63
63
  files:
64
- - lib/ratecounter.rb
65
64
  - lib/dm-xml-adapter.rb
66
- - spec/spec_helper.rb
65
+ - lib/ratecounter.rb
67
66
  - spec/dm-xml-adapter_spec.rb
67
+ - spec/spec_helper.rb
68
68
  - README
69
69
  has_rdoc: true
70
70
  homepage:
@@ -95,5 +95,5 @@ signing_key:
95
95
  specification_version: 3
96
96
  summary: a XML adapter for DataMapper. this adapter allows you to use DataMapper with XML files as a backing store.
97
97
  test_files:
98
- - spec/spec_helper.rb
99
98
  - spec/dm-xml-adapter_spec.rb
99
+ - spec/spec_helper.rb