salesforce_fsdb 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5800738a75803b32473b3cf8004f4132922692b0
4
- data.tar.gz: 2bb44d97b73ec6c5d266ff908af62f3d6c7a53de
3
+ metadata.gz: c87c8485d4423ec3114ed81ce8f6b17ab2c4fe62
4
+ data.tar.gz: 373b609ea36ccda2e15d9d67fff109a1a48a83b0
5
5
  SHA512:
6
- metadata.gz: 3af6c597ceacb8b27a0c8896b0f374300442e9b4a8ff8bcca61d68b858d45f7054a7c302f6e5d5d2e49abbbb1139635922c403dda741c565beb9bea9804965af
7
- data.tar.gz: f6d3d8dee9c54328bc014eb2a1537082af1d04f1edaacce6bdd3dc35fecc1c6c9b36fcdf2fa356970370c992d7bf7c71201febc0f60d9860626611a31828d05c
6
+ metadata.gz: fed0a9646f5c1719c5650b36ca5a46def6fce0d4d937e85b66139d28a31a0f47e314add0eb024170ceb0880d19660260fa6ad30ef242ba2047ac122b3b2e6fb1
7
+ data.tar.gz: b09fd6cc9180f3fb284212027f1bc7f88817a462fba514ca945a8d997cb1fc573fe58a5284b7469ddbf9ff49dda5f8d15600094804119b3475e9620fedcebac8
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.0.4
2
+ - Add "redirect" in case an Opportunity Id is presented for an Account sObject.
3
+ - Add autoload to enable "require 'salesforce_fsdb'"
4
+
1
5
  = 0.0.3
2
6
  - Add SOQL result caching.
3
7
 
data/README.rdoc CHANGED
@@ -12,7 +12,7 @@ Download and install salesforce_fsdb with the following:
12
12
 
13
13
  == Usage
14
14
 
15
- require 'salesforce_fsdb/client'
15
+ require 'salesforce_fsdb'
16
16
 
17
17
  paramsGeneral = {
18
18
  :api_fqdn => 'na1.salesforce.com',
@@ -59,6 +59,10 @@ SOQL results are stored in the path indicated. Sub-directories are created for S
59
59
 
60
60
  Some large Salesforce Objects may generate Salesforce errors. A future release will allow specifying specific fields for retrieval.
61
61
 
62
+ === Redirection
63
+
64
+ In the event an Account sObject request results in a NOT_FOUND error for a given Salesforce Id, the library will attempt to use the Id as an Opportunity Id and, if successful, will return the proper Account sObject.
65
+
62
66
  == Links
63
67
 
64
68
  Salesforce REST API Reference
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -96,7 +96,21 @@ module SalesforceFsdb
96
96
 
97
97
  def getSobjectForSfidAndTypeFromRemote(sSfid=nil,sType=nil)
98
98
  dObj = @oSfRestClient.getSobjectForSfidAndType(sSfid,sType)
99
- if dObj.has_key?(:Id)
99
+ if (dObj.is_a?(Array) && dObj[0][:errorCode] == 'NOT_FOUND') || dObj.nil?
100
+ if sType == 'Account'
101
+
102
+ dObjOppTry = self.getSobjectForSfidAndType(sSfid,'Opportunity')
103
+
104
+ if dObjOppTry.is_a?(Hash) && dObjOppTry.has_key?(:AccountId)
105
+ sSfidAct = dObjOppTry[:AccountId]
106
+ return self.getSobjectForSfidAndType(sSfidAct,sType)
107
+ end
108
+
109
+ else
110
+ return nil
111
+ end
112
+ end
113
+ if dObj.is_a?(Hash) && dObj.has_key?(:Id)
100
114
  sDir = self.getDirForType(sType)
101
115
  sPath = self.getPathForSfidAndType(sSfid,sType)
102
116
  FileUtils.mkdir_p(sDir) if ! Dir.exists?(sDir)
@@ -0,0 +1,4 @@
1
+ module SalesforceFsdb
2
+ autoload :Client, 'salesforce_fsdb/client'
3
+ autoload :RestClient, 'salesforce_fsdb/rest_client'
4
+ end
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'salesforce_fsdb'
3
- s.version = '0.0.3'
4
- s.date = '2014-02-06'
3
+ s.version = '0.0.4'
4
+ s.date = '2014-02-19'
5
5
  s.summary = 'Salesforce Filesystem DB'
6
- s.description = 'Filesystem cache manager for Salesforce sObjects'
6
+ s.description = 'Filesystem cache manager for Salesforce sObjects and SOQL results'
7
7
  s.authors = ['John Wang']
8
8
  s.email = 'johncwang@gmail.com'
9
9
  s.files = [
@@ -13,10 +13,11 @@ Gem::Specification.new do |s|
13
13
  'Rakefile',
14
14
  'VERSION',
15
15
  'salesforce_fsdb.gemspec',
16
+ 'lib/salesforce_fsdb.rb',
16
17
  'lib/salesforce_fsdb/client.rb',
17
18
  'lib/salesforce_fsdb/rest_client.rb',
18
19
  'test/test_setup.rb'
19
20
  ]
20
21
  s.homepage = 'http://johnwang.com/'
21
22
  s.license = 'MIT'
22
- end
23
+ end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce_fsdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Wang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-06 00:00:00.000000000 Z
11
+ date: 2014-02-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Filesystem cache manager for Salesforce sObjects
13
+ description: Filesystem cache manager for Salesforce sObjects and SOQL results
14
14
  email: johncwang@gmail.com
15
15
  executables: []
16
16
  extensions: []
@@ -21,6 +21,7 @@ files:
21
21
  - README.rdoc
22
22
  - Rakefile
23
23
  - VERSION
24
+ - lib/salesforce_fsdb.rb
24
25
  - lib/salesforce_fsdb/client.rb
25
26
  - lib/salesforce_fsdb/rest_client.rb
26
27
  - salesforce_fsdb.gemspec