dm-zone-types 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -13,5 +13,6 @@ group :development do
13
13
  gem 'dm-sqlite-adapter'
14
14
  gem 'dm-migrations'
15
15
  gem 'i18n'
16
+ gem 'dm-validations'
16
17
  end
17
18
 
@@ -4,15 +4,15 @@ dependencies:
4
4
  group:
5
5
  - :default
6
6
  version: ">= 0"
7
- rake:
7
+ dm-validations:
8
8
  group:
9
9
  - :development
10
10
  version: ">= 0"
11
- tumbler:
11
+ rake:
12
12
  group:
13
13
  - :development
14
14
  version: ">= 0"
15
- watchr:
15
+ tumbler:
16
16
  group:
17
17
  - :development
18
18
  version: ">= 0"
@@ -20,6 +20,10 @@ dependencies:
20
20
  group:
21
21
  - :default
22
22
  version: ">= 0"
23
+ watchr:
24
+ group:
25
+ - :development
26
+ version: ">= 0"
23
27
  nanotest_extensions:
24
28
  group:
25
29
  - :development
@@ -28,11 +32,15 @@ dependencies:
28
32
  group:
29
33
  - :development
30
34
  version: ">= 0"
35
+ nanotest:
36
+ group:
37
+ - :development
38
+ version: ">= 0"
31
39
  i18n:
32
40
  group:
33
41
  - :development
34
42
  version: ">= 0"
35
- nanotest:
43
+ dm-migrations:
36
44
  group:
37
45
  - :development
38
46
  version: ">= 0"
@@ -40,10 +48,6 @@ dependencies:
40
48
  group:
41
49
  - :default
42
50
  version: ">= 3.0.0.beta3"
43
- dm-migrations:
44
- group:
45
- - :development
46
- version: ">= 0"
47
51
  specs:
48
52
  - rake:
49
53
  version: 0.8.7
@@ -71,6 +75,8 @@ specs:
71
75
  version: 0.10.2
72
76
  - dm-sqlite-adapter:
73
77
  version: 1.0.0
78
+ - dm-validations:
79
+ version: 1.0.0
74
80
  - i18n:
75
81
  version: 0.4.1
76
82
  - json:
@@ -91,7 +97,7 @@ specs:
91
97
  version: 0.3.22
92
98
  - watchr:
93
99
  version: "0.6"
94
- hash: 9d371af4c0abbf9dd0cff9cf922f7448268590cc
100
+ hash: 70f186d5e2b963e6e35c4ade89ccbd628b30ebca
95
101
  sources:
96
102
  - Rubygems:
97
103
  uri: http://gemcutter.org
@@ -2,7 +2,7 @@
2
2
  module DataMapper
3
3
  module Zone
4
4
  module Types #:nodoc
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
8
8
  end
@@ -7,7 +7,7 @@ module DataMapper
7
7
  include DataMapper::Zone::Types
8
8
 
9
9
  def load(value)
10
- value.in_time_zone(::Time.zone)
10
+ value.nil? ? nil : value.in_time_zone(::Time.zone)
11
11
  end
12
12
 
13
13
  def dump(value)
@@ -25,6 +25,14 @@ context do
25
25
  SpecModel.new.zoned_time.must == nil
26
26
  end
27
27
 
28
+
29
+ test do
30
+ model = SpecModel.new
31
+ model.save
32
+ model.new?.must == false
33
+ model.zoned_time.must == nil
34
+ end
35
+
28
36
  # should typecast to a DateTime from a string
29
37
  test do
30
38
  model = SpecModel.new(:zoned_time => "2009-12-13 12:13:14")
@@ -9,6 +9,7 @@ $:.unshift( File.join(File.expand_path(File.dirname(__FILE__)), "..", "lib"))
9
9
 
10
10
  require 'dm-zone-types'
11
11
  require 'dm-migrations'
12
+ require 'dm-validations'
12
13
 
13
14
  include Nanotest
14
15
  include Nanotest::Contexts
@@ -18,5 +19,5 @@ DataMapper.setup(:default, 'sqlite::memory:')
18
19
  class SpecModel
19
20
  include DataMapper::Resource
20
21
  property :id, Serial
21
- property :zoned_time, ZonedTime
22
+ property :zoned_time, ZonedTime, :required => false
22
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-zone-types
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Neighman
@@ -28,8 +28,8 @@ dependencies:
28
28
  segments:
29
29
  - 0
30
30
  version: "0"
31
- name: dm-core
32
31
  requirement: *id001
32
+ name: dm-core
33
33
  prerelease: false
34
34
  type: :runtime
35
35
  - !ruby/object:Gem::Dependency
@@ -45,8 +45,8 @@ dependencies:
45
45
  - 0
46
46
  - beta3
47
47
  version: 3.0.0.beta3
48
- name: activesupport
49
48
  requirement: *id002
49
+ name: activesupport
50
50
  prerelease: false
51
51
  type: :runtime
52
52
  - !ruby/object:Gem::Dependency
@@ -59,8 +59,8 @@ dependencies:
59
59
  segments:
60
60
  - 0
61
61
  version: "0"
62
- name: tzinfo
63
62
  requirement: *id003
63
+ name: tzinfo
64
64
  prerelease: false
65
65
  type: :runtime
66
66
  - !ruby/object:Gem::Dependency
@@ -73,8 +73,8 @@ dependencies:
73
73
  segments:
74
74
  - 0
75
75
  version: "0"
76
- name: tumbler
77
76
  requirement: *id004
77
+ name: tumbler
78
78
  prerelease: false
79
79
  type: :development
80
80
  - !ruby/object:Gem::Dependency
@@ -87,8 +87,8 @@ dependencies:
87
87
  segments:
88
88
  - 0
89
89
  version: "0"
90
- name: nanotest
91
90
  requirement: *id005
91
+ name: nanotest
92
92
  prerelease: false
93
93
  type: :development
94
94
  - !ruby/object:Gem::Dependency
@@ -101,8 +101,8 @@ dependencies:
101
101
  segments:
102
102
  - 0
103
103
  version: "0"
104
- name: nanotest_extensions
105
104
  requirement: *id006
105
+ name: nanotest_extensions
106
106
  prerelease: false
107
107
  type: :development
108
108
  - !ruby/object:Gem::Dependency
@@ -115,8 +115,8 @@ dependencies:
115
115
  segments:
116
116
  - 0
117
117
  version: "0"
118
- name: watchr
119
118
  requirement: *id007
119
+ name: watchr
120
120
  prerelease: false
121
121
  type: :development
122
122
  - !ruby/object:Gem::Dependency
@@ -129,8 +129,8 @@ dependencies:
129
129
  segments:
130
130
  - 0
131
131
  version: "0"
132
- name: rake
133
132
  requirement: *id008
133
+ name: rake
134
134
  prerelease: false
135
135
  type: :development
136
136
  - !ruby/object:Gem::Dependency
@@ -143,8 +143,8 @@ dependencies:
143
143
  segments:
144
144
  - 0
145
145
  version: "0"
146
- name: dm-sqlite-adapter
147
146
  requirement: *id009
147
+ name: dm-sqlite-adapter
148
148
  prerelease: false
149
149
  type: :development
150
150
  - !ruby/object:Gem::Dependency
@@ -157,8 +157,8 @@ dependencies:
157
157
  segments:
158
158
  - 0
159
159
  version: "0"
160
- name: dm-migrations
161
160
  requirement: *id010
161
+ name: dm-migrations
162
162
  prerelease: false
163
163
  type: :development
164
164
  - !ruby/object:Gem::Dependency
@@ -171,8 +171,22 @@ dependencies:
171
171
  segments:
172
172
  - 0
173
173
  version: "0"
174
- name: i18n
175
174
  requirement: *id011
175
+ name: i18n
176
+ prerelease: false
177
+ type: :development
178
+ - !ruby/object:Gem::Dependency
179
+ version_requirements: &id012 !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ hash: 3
185
+ segments:
186
+ - 0
187
+ version: "0"
188
+ requirement: *id012
189
+ name: dm-validations
176
190
  prerelease: false
177
191
  type: :development
178
192
  description: Timezone aware datatypes for DataMapper