gd_bam 0.1.22 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
data/lib/bam/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bam
2
- VERSION = '0.1.22'
2
+ VERSION = '0.1.23'
3
3
  end
@@ -34,25 +34,6 @@ module GoodData
34
34
  generate_select(tap)
35
35
  end
36
36
 
37
- # def self.generate_history_query(client, field, sf_object, for_sf_object)
38
- # fields = client.fields(sf_object)
39
- # generic_field_history = ["NewValue", "OldValue", "ParentId"].all? {|f| fields.include?(f)}
40
- # specific_field_history = ["NewValue", "OldValue", "#{for_sf_object}Id"].all? {|f| fields.include?(f)}
41
- # specific_history = ["SystemModstamp", "#{for_sf_object}Id"].all? {|f| fields.include?(f)}
42
- #
43
- #
44
- # if generic_field_history
45
- # "SELECT NewValue, CreatedDate, ParentId FROM #{sf_object} WHERE Field = '#{field}'"
46
- # elsif specific_field_history
47
- # "SELECT NewValue, CreatedDate, ParentId FROM #{sf_object} WHERE Field = '#{field}'"
48
- # elsif specific_history
49
- # return nil unless fields.include?(field)
50
- # "SELECT #{field}, SystemModstamp, #{for_sf_object}Id FROM #{sf_object}"
51
- # else
52
- # fail "Unrecognized fields configuration for historization in SF."
53
- # end
54
- # end
55
-
56
37
  def self.sf_connection(builder, data)
57
38
  builder.Connection({
58
39
  :clientId => "${SFDC_CLIENT_ID}",
@@ -408,7 +408,7 @@ HEREDOC
408
408
  specific_field_history = ["NewValue", "OldValue", "#{sf_object}Id"].all? {|fl| fields.include?(fl)}
409
409
  specific_history = ["CreatedDate", "#{sf_object}Id"].all? {|fl| fields.include?(fl)}
410
410
 
411
- select, mapping, mandatory = if generic_field_history
411
+ select, mapping, mandatory = if generic_field_history && !field[:multi_currency]
412
412
  # This kicks in when you have Field History type of table. There are several versions in SF. This one deals with the one that references ID of the record as Pernt Id. This is not true for opportunity, account.
413
413
  [
414
414
  "SELECT NewValue, CreatedDate, ParentId FROM #{o} WHERE Field = '#{f}'",
@@ -419,7 +419,7 @@ HEREDOC
419
419
  ]}}",
420
420
  ["ParentId", "NewValue", "CreatedDate"]
421
421
  ]
422
- elsif specific_field_history
422
+ elsif (specific_field_history && !field[:multi_currency])
423
423
  # This is like the previous with the difference that it specifically names the id of the record. Like OpportunityId, AccountId, etc.
424
424
  [
425
425
  "SELECT NewValue, CreatedDate, #{sf_object}Id FROM #{o} WHERE Field = '#{f}'",
@@ -434,7 +434,7 @@ HEREDOC
434
434
  # Specific history is the row like history. The only instance I know of is OpportunityHistory.
435
435
  if fields.include?(f)
436
436
  [
437
- "SELECT #{f}, CreatedDate, #{sf_object}Id FROM #{o}",
437
+ (field[:multi_currency] ? "SELECT convertCurrency(#{f}), CreatedDate, #{sf_object}Id FROM #{o}" : "SELECT #{f}, CreatedDate, #{sf_object}Id FROM #{o}"),
438
438
  "{\"xmlFieldsMapping\":{\"xmlFields\":[
439
439
  {\"xmlFieldMapping\":{\"name\":\"#{f}\",\"label\":\"#{f}\",\"xmlPath\":\"#{f}\",\"metadataField\":\"Value\"}},
440
440
  {\"xmlFieldMapping\":{\"name\":\"CreatedDate\",\"label\":\"CreatedDate\",\"xmlPath\":\"CreatedDate\",\"metadataField\":\"Timestamp\"}},
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gd_bam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-16 00:00:00.000000000 Z
12
+ date: 2013-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake