dm-persevere-adapter 0.71.1 → 0.71.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/dm/resource.rb +14 -9
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.71.
|
1
|
+
0.71.2
|
data/lib/dm/resource.rb
CHANGED
@@ -77,17 +77,22 @@ module DataMapper
|
|
77
77
|
end
|
78
78
|
|
79
79
|
attributes(:property).each do |property, value|
|
80
|
+
# debugger if model.name == 'Yogo::Setting' && property.name == :value
|
80
81
|
next if value.nil? || (value.is_a?(Array) && value.empty?) || relations.include?(property.name.to_s)
|
81
82
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
83
|
+
if property.type.respond_to?(:dump)
|
84
|
+
json_rsrc[property.field] = property.type.dump(value, nil)
|
85
|
+
else
|
86
|
+
json_rsrc[property.field] = case value
|
87
|
+
when DateTime then value.new_offset(0).strftime("%Y-%m-%dT%H:%M:%SZ")
|
88
|
+
when Date then value.to_s
|
89
|
+
when Time then value.strftime("%H:%M:%S")
|
90
|
+
when Float then value.to_f
|
91
|
+
when BigDecimal then value.to_f
|
92
|
+
when Integer then value.to_i
|
93
|
+
else # when String, TrueClass, FalseClass then
|
94
|
+
self[property.name]
|
95
|
+
end
|
91
96
|
end
|
92
97
|
end
|
93
98
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-persevere-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 263
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 71
|
9
|
-
-
|
10
|
-
version: 0.71.
|
9
|
+
- 2
|
10
|
+
version: 0.71.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ivan R. Judson
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-07-
|
19
|
+
date: 2010-07-02 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|