dm-xml-adapter 0.572 → 0.573
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/lib/dm-xml-adapter.rb +3 -3
- metadata +1 -1
data/lib/dm-xml-adapter.rb
CHANGED
@@ -263,7 +263,7 @@ module DataMapper::Adapters
|
|
263
263
|
# special case for false
|
264
264
|
if property.primitive == TrueClass and value == false
|
265
265
|
xml.tag!(property.name.to_s, false, :class => FalseClass.to_s)
|
266
|
-
elsif (
|
266
|
+
elsif (property.primitive == BigDecimal and value != nil)
|
267
267
|
xml.tag!(property.name.to_s, value.to_s("F"), :class => BigDecimal)
|
268
268
|
elsif (value != nil)
|
269
269
|
xml.tag!(property.name.to_s, value, :class => property.primitive)
|
@@ -271,8 +271,8 @@ module DataMapper::Adapters
|
|
271
271
|
end
|
272
272
|
end
|
273
273
|
|
274
|
-
xmlfile = File.new(class_name_to_file(
|
275
|
-
tempfile = Tempfile.new("dm-xml-adapter",
|
274
|
+
xmlfile = File.new(class_name_to_file(resource_class, resource_key), "w")
|
275
|
+
tempfile = Tempfile.new("dm-xml-adapter", Dir.tmpdir())
|
276
276
|
tempfile.puts out_string
|
277
277
|
tempfile.close
|
278
278
|
FileUtils.mv(tempfile.path,xmlfile.path)
|