SFDO-API 0.1.7 → 0.1.8

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: babfcf40f932d8dd641788b972341bdf8b0ef602
4
- data.tar.gz: 169d8dcc00a47bcb0249df2370cd294a13675a2e
3
+ metadata.gz: 86bbbf264ca82309c28f8c0a9c5f4be086262d04
4
+ data.tar.gz: 1686e09eb843f172dc73b03ded1e2e618921a81b
5
5
  SHA512:
6
- metadata.gz: 165c8a21f5e2b246e3c0b960f96d0d20cee1f454f888403451d2ec1267358e116a50f8ab01d2b9bedd145c0e3dcc9778ccdad915e7fd30b8e1ce9b91da6ff44e
7
- data.tar.gz: 60ab690da0d5a07dddc8a6371d579dc2241ff65a4d27ec3397a49a3934b3d237a1a21cd4d49805e704f5cd70ae74e54541345c6bcb29d03d4bd83c61d42685b2
6
+ metadata.gz: c92d71ffd9d167b7ac9b14ddab4948ad47e9ea56d5c3039dbc418d2be089be03a900d6838b0c56aebca7d662d9df92608c339cb0dd75125485d9b375b2f03cb6
7
+ data.tar.gz: b2be7f31158d87e98e0fe921ce5b9290a2b75199354ef02e301497f2898dcb783b08642453eb465d826eabe9697c085ef37e0df91db8e076c21c17673129270a
data/README.md CHANGED
@@ -111,6 +111,27 @@ puts gaus.inspect
111
111
  end
112
112
  ```
113
113
 
114
+ ### SELECT and UPDATE actions with custom objects
115
+
116
+ Use the select_api() and update_api() methods without namespaces or trailing characters.
117
+
118
+ Issuing the select_api() call populates the entire object hash in restforce. Alter the value in the object hash you wish
119
+ to change, then call update_api() with the altered version of the restforce object hash.
120
+
121
+ ```ruby
122
+ def update_account_model(to_value)
123
+ api_client do
124
+ acc_id = select_api 'select Id from Contacts_And_Orgs_Settings'
125
+ acc = acc_id.first
126
+ acc.npe01__Account_Processor__c = to_value
127
+ update_api(acc)
128
+ end
129
+ end
130
+ ```
131
+
132
+ Note that at this time, *fields* on objects with custom namespaces are not discovered automatically at runtime.
133
+ See TODO section below:
134
+
114
135
  ### Using objects where local override changes required fields
115
136
 
116
137
  Note that ISVs may override required fields on standard Salesforce objects, and these may be needed for SFDO-API to work properly
@@ -129,7 +150,6 @@ Fields on namespaced object may be namespaced themselves. SFDO-API does not hand
129
150
 
130
151
  Custom fields on standard Salesforce objects may have namespaces. SFDO-API does not handle such fields yet.
131
152
 
132
-
133
153
  ## Development
134
154
 
135
155
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -135,6 +135,10 @@ module SfdoAPI
135
135
  end
136
136
  end
137
137
 
138
+ def update_api(obj)
139
+ @api_client.update(obj.attributes.type, obj)
140
+ end
141
+
138
142
  def method_missing(method_called, *args, &block)
139
143
  breakdown = method_called.to_s.split('_')
140
144
  obj_type = breakdown.last.capitalize
@@ -148,8 +152,6 @@ module SfdoAPI
148
152
  create obj_type, *args
149
153
  when /^select_api/
150
154
  select_api *args
151
- when /^update/
152
- #TODO
153
155
  else
154
156
  super.method_missing
155
157
  end
@@ -1,5 +1,5 @@
1
1
  module SFDO
2
2
  module API
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SFDO-API
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris McMahon
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-10-21 00:00:00.000000000 Z
12
+ date: 2016-10-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler