We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a49a6e9 + 1bbda30 commit 3b7195fCopy full SHA for 3b7195f
lib/qbxml/types.rb
@@ -1,12 +1,12 @@
1
module Qbxml::Types
2
3
- XML_DIRECTIVES = {
+ XML_DIRECTIVES = {
4
:qb => [:qbxml, { version: '7.0' }],
5
:qbpos => [:qbposxml, { version: '3.0' }]
6
}.freeze
7
8
FLOAT_CAST = Proc.new {|d| d ? Float(d) : 0.0}
9
- BOOL_CAST = Proc.new {|d| d ? (d == 'True' ? true : false) : false }
+ BOOL_CAST = Proc.new {|d| d ? (d.to_s.downcase == 'true' ? true : false) : false }
10
DATE_CAST = Proc.new {|d| d ? Date.parse(d).strftime("%Y-%m-%d") : Date.today.strftime("%Y-%m-%d") }
11
TIME_CAST = Proc.new {|d| d ? Time.parse(d).xmlschema : Time.now.xmlschema }
12
INT_CAST = Proc.new {|d| d ? Integer(d.to_i) : 0 }
0 commit comments