activesalesforce 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/asf_adapter.rb +13 -3
  2. metadata +2 -2
data/lib/asf_adapter.rb CHANGED
@@ -151,7 +151,7 @@ module ActiveRecord
151
151
 
152
152
 
153
153
  # QUOTING ==================================================
154
-
154
+
155
155
  def quote(value, column = nil)
156
156
  case value
157
157
  when NilClass then quoted_value = "NULL"
@@ -522,8 +522,18 @@ module ActiveRecord
522
522
 
523
523
  value.gsub!(/''/, "'") if value.is_a? String
524
524
 
525
- include_field = ((not value.empty?) and column.send(access_check))
526
- fields[column.api_name] = value if include_field
525
+ include_field = ((not value.empty?) and column.send(access_check))
526
+
527
+ if (include_field)
528
+ case column.type
529
+ when :date
530
+ value = Time.parse(value + "Z").utc.strftime("%Y-%m-%d")
531
+ when :datetime
532
+ value = Time.parse(value + "Z").utc.strftime("%Y-%m-%dT%H:%M:%SZ")
533
+ end
534
+
535
+ fields[column.api_name] = value
536
+ end
527
537
  end
528
538
  end
529
539
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: activesalesforce
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.2
7
- date: 2006-07-19 00:00:00 -04:00
6
+ version: 0.6.3
7
+ date: 2006-08-07 00:00:00 -04:00
8
8
  summary: ActiveSalesforce (ASF) is a Rails connection adapter that provides direct access to Salesforce.com hosted data and metadata via the ActiveRecord model layer. Objects, fields, and relationships are all auto surfaced as active record attributes and rels.
9
9
  require_paths:
10
10
  - lib