id 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4a4830e44c543e20bfbd0a69894f31e33f255d60
4
+ data.tar.gz: 910da24aa9829a4dbea10c6c77e64773fdf188bd
5
+ SHA512:
6
+ metadata.gz: 69f2da5ba66e623889de506206115604a152536f97dbfbcb75dbf00967d16fbf843d9aaae12c3d8f970d5ce4726aae2ee1691362330fc0b0d5faf6541c32915a
7
+ data.tar.gz: 3ea228e5c3c75256a77029b523236ae9e6be7cc264ae9db92b3b53d86b33456c4dfe2ad188f86e7fe4fa5e2c69687c53172a2a3d796c12a4b91fdb24b25fc5c5
@@ -1 +1 @@
1
- ree-1.8.7-2012.02
1
+ 2.0.0-p247
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- id (0.0.10)
4
+ id (0.0.11)
5
5
  activemodel
6
6
  activesupport
7
7
  money
@@ -10,16 +10,21 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activemodel (3.2.12)
14
- activesupport (= 3.2.12)
15
- builder (~> 3.0.0)
16
- activesupport (3.2.12)
17
- i18n (~> 0.6)
18
- multi_json (~> 1.0)
19
- builder (3.0.4)
13
+ activemodel (4.0.0)
14
+ activesupport (= 4.0.0)
15
+ builder (~> 3.1.0)
16
+ activesupport (4.0.0)
17
+ i18n (~> 0.6, >= 0.6.4)
18
+ minitest (~> 4.2)
19
+ multi_json (~> 1.3)
20
+ thread_safe (~> 0.1)
21
+ tzinfo (~> 0.3.37)
22
+ atomic (1.1.12)
23
+ builder (3.1.4)
20
24
  diff-lcs (1.2.1)
21
25
  i18n (0.6.4)
22
26
  json (1.7.7)
27
+ minitest (4.7.5)
23
28
  money (3.7.1)
24
29
  i18n (~> 0.4)
25
30
  multi_json (1.7.3)
@@ -37,6 +42,9 @@ GEM
37
42
  simplecov-html (~> 0.7.1)
38
43
  simplecov-html (0.7.1)
39
44
  test-unit (2.5.5)
45
+ thread_safe (0.1.2)
46
+ atomic
47
+ tzinfo (0.3.37)
40
48
 
41
49
  PLATFORMS
42
50
  ruby
data/id.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'id'
3
- s.version = '0.0.11'
3
+ s.version = '0.0.12'
4
4
  s.date = '2013-03-28'
5
5
  s.summary = "Simple models based on hashes"
6
6
  s.description = "Developed at On The Beach Ltd. Contact russell.dunphy@onthebeach.co.uk"
@@ -21,6 +21,10 @@ module Id
21
21
  self
22
22
  end
23
23
 
24
+ def to_partial_path
25
+ model.respond_to?(:to_partial_path) ? model.to_partial_path : super
26
+ end
27
+
24
28
  private
25
29
 
26
30
  def method_missing(name, *args, &block)
@@ -23,7 +23,7 @@ module Id
23
23
  end
24
24
 
25
25
  def presence_of(data)
26
- data.has_key?(key) && !data.fetch(key).nil?
26
+ data.has_key?(key) && data.fetch(key)
27
27
  end
28
28
 
29
29
  def cast(value)
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'date'
2
3
 
3
4
  class OptionalModel
4
5
  include Id::Model
@@ -15,6 +16,7 @@ class TestModel
15
16
 
16
17
  field :foo
17
18
  field :bar, :key => 'baz'
19
+ field :baz
18
20
  field :qux, :optional => true
19
21
  field :quux, :default => false
20
22
  field :date_of_birth, :optional => true, :type => Date
@@ -148,9 +150,10 @@ describe Id::Model do
148
150
 
149
151
  describe "#fields are present methods" do
150
152
  it 'allows you to check if fields are present' do
151
- model = TestModel.new(:foo => 1)
153
+ model = TestModel.new(:foo => 1, :baz => false)
152
154
  model.foo?.should be_true
153
155
  model.bar?.should be_false
156
+ model.baz?.should be_false
154
157
  end
155
158
  end
156
159
 
metadata CHANGED
@@ -1,118 +1,108 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: id
3
- version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 11
10
- version: 0.0.11
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.12
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Russell Dunphy
14
8
  - Radek Molenda
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2013-03-28 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: optional
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
33
21
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: money
37
22
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: money
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
47
35
  type: :runtime
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: activesupport
51
36
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: activesupport
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
61
49
  type: :runtime
62
- version_requirements: *id003
63
- - !ruby/object:Gem::Dependency
64
- name: activemodel
65
50
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
- version: "0"
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: activemodel
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
75
63
  type: :runtime
76
- version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
78
- name: rspec
79
64
  prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rspec
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
89
77
  type: :development
90
- version_requirements: *id005
91
- - !ruby/object:Gem::Dependency
92
- name: simplecov
93
78
  prerelease: false
94
- requirement: &id006 !ruby/object:Gem::Requirement
95
- none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- hash: 3
100
- segments:
101
- - 0
102
- version: "0"
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: simplecov
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
103
91
  type: :development
104
- version_requirements: *id006
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
105
98
  description: Developed at On The Beach Ltd. Contact russell.dunphy@onthebeach.co.uk
106
- email:
99
+ email:
107
100
  - rssll@rsslldnphy.com
108
101
  - radek.molenda@gmail.com
109
102
  executables: []
110
-
111
103
  extensions: []
112
-
113
104
  extra_rdoc_files: []
114
-
115
- files:
105
+ files:
116
106
  - .gitignore
117
107
  - .rspec
118
108
  - .ruby-version
@@ -149,38 +139,28 @@ files:
149
139
  - spec/support/active_model_lint.rb
150
140
  homepage: http://github.com/onthebeach/id
151
141
  licenses: []
152
-
142
+ metadata: {}
153
143
  post_install_message:
154
144
  rdoc_options: []
155
-
156
- require_paths:
145
+ require_paths:
157
146
  - lib
158
- required_ruby_version: !ruby/object:Gem::Requirement
159
- none: false
160
- requirements:
161
- - - ">="
162
- - !ruby/object:Gem::Version
163
- hash: 3
164
- segments:
165
- - 0
166
- version: "0"
167
- required_rubygems_version: !ruby/object:Gem::Requirement
168
- none: false
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- hash: 3
173
- segments:
174
- - 0
175
- version: "0"
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - '>='
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - '>='
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
176
157
  requirements: []
177
-
178
158
  rubyforge_project:
179
- rubygems_version: 1.8.25
159
+ rubygems_version: 2.0.3
180
160
  signing_key:
181
- specification_version: 3
161
+ specification_version: 4
182
162
  summary: Simple models based on hashes
183
- test_files:
163
+ test_files:
184
164
  - spec/lib/id/model/association_spec.rb
185
165
  - spec/lib/id/model/field_spec.rb
186
166
  - spec/lib/id/model/form_spec.rb