simple_model 0.2.4 → 0.2.5
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 +4 -4
- data/lib/simple_model/attributes.rb +5 -5
- data/lib/simple_model/version.rb +1 -1
- metadata +3 -5
data/Gemfile.lock
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simple_model (0.2.
|
4
|
+
simple_model (0.2.5)
|
5
5
|
activemodel (~> 3.0.5)
|
6
6
|
activesupport (~> 3.0.5)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (3.0.
|
12
|
-
activesupport (= 3.0.
|
11
|
+
activemodel (3.0.9)
|
12
|
+
activesupport (= 3.0.9)
|
13
13
|
builder (~> 2.1.2)
|
14
14
|
i18n (~> 0.5.0)
|
15
|
-
activesupport (3.0.
|
15
|
+
activesupport (3.0.9)
|
16
16
|
builder (2.1.2)
|
17
17
|
diff-lcs (1.1.2)
|
18
18
|
i18n (0.5.0)
|
@@ -159,8 +159,9 @@ module SimpleModel
|
|
159
159
|
|
160
160
|
attr_reader attr
|
161
161
|
define_reader_with_options(attr,options)
|
162
|
-
define_method("#{attr.to_s}=") do |val|
|
163
|
-
|
162
|
+
define_method("#{attr.to_s}=") do |val|
|
163
|
+
val = val.to_date unless val.nil?
|
164
|
+
instance_variable_set("@#{attr}", val )
|
164
165
|
attributes[attr] = val
|
165
166
|
val
|
166
167
|
|
@@ -172,12 +173,11 @@ module SimpleModel
|
|
172
173
|
def has_times(*attrs)
|
173
174
|
options = attrs.extract_options!
|
174
175
|
attrs.each do |attr|
|
175
|
-
|
176
176
|
attr_reader attr
|
177
177
|
define_reader_with_options(attr,options)
|
178
178
|
define_method("#{attr.to_s}=") do |val|
|
179
|
-
|
180
|
-
instance_variable_set("@#{attr}", val
|
179
|
+
val = val.to_time unless val.nil?
|
180
|
+
instance_variable_set("@#{attr}", val)
|
181
181
|
attributes[attr] = val
|
182
182
|
val
|
183
183
|
end
|
data/lib/simple_model/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: simple_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Joshua T Mckinney
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-08-12 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: activesupport
|
@@ -77,7 +76,6 @@ files:
|
|
77
76
|
- spec/simple_model_spec.rb
|
78
77
|
- spec/spec.opts
|
79
78
|
- spec/spec_helper.rb
|
80
|
-
has_rdoc: true
|
81
79
|
homepage: ""
|
82
80
|
licenses: []
|
83
81
|
|
@@ -101,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
99
|
requirements: []
|
102
100
|
|
103
101
|
rubyforge_project: simple_model
|
104
|
-
rubygems_version: 1.6
|
102
|
+
rubygems_version: 1.8.6
|
105
103
|
signing_key:
|
106
104
|
specification_version: 3
|
107
105
|
summary: Simpifies building tableless models or models backed by webservices
|