active_force 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +22 -1
- data/lib/active_force.rb +7 -0
- data/lib/active_force/association/association.rb +1 -1
- data/lib/active_force/sobject.rb +1 -1
- data/lib/active_force/version.rb +1 -1
- data/spec/active_force/association_spec.rb +1 -1
- data/spec/active_force/callbacks_spec.rb +1 -1
- data/spec/active_force/sobject/includes_spec.rb +1 -1
- data/spec/active_force/sobject_spec.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 856379b1407c72d56da2e86be62b2a54af211d85
|
4
|
+
data.tar.gz: f35e9f84f5278754333157b749df193ce9f60034
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15db0f8a8df68c7db8cf3eb8e2ebf5304748807823957b61e2348a90459615a7140b7fdf20753ad832ce7c2a24fb9a76e3df612bbde1b44e780d220f8f0f451c
|
7
|
+
data.tar.gz: e571dcf6b46d18b2d7fe1927600b7aafccbb5d12506ddaba558dbe3f18373967e5514818542b1d17d7cab455bfc9fea4f474ece36aed8fe768359e52cd14b65a
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
## Not released
|
4
|
+
|
5
|
+
## 0.7.1
|
6
|
+
|
7
|
+
* Allow sfdc_client to be set. ([#92][])
|
8
|
+
|
9
|
+
## 0.7.0
|
10
|
+
|
4
11
|
* Rails4-style conditional has_many associations ([Dan Olson][])
|
5
12
|
* Add `#includes` query method to eager load has_many association. ([Dan Olson][])
|
6
13
|
* Add `#includes` query method to eager load belongs_to association. ([#65][])
|
@@ -84,6 +91,7 @@
|
|
84
91
|
[#30]: https://github.com/ionia-corporation/active_force/issues/30
|
85
92
|
[#33]: https://github.com/ionia-corporation/active_force/issues/33
|
86
93
|
[#65]: https://github.com/ionia-corporation/active_force/issues/65
|
94
|
+
[#92]: https://github.com/ionia-corporation/active_force/issues/92
|
87
95
|
[Pablo Oldani]: https://github.com/olvap
|
88
96
|
[Armando Andini]: https://github.com/antico5
|
89
97
|
[José Piccioni]: https://github.com/lmhsjackson
|
data/README.md
CHANGED
@@ -38,6 +38,19 @@ environment variables to set up credentials.
|
|
38
38
|
|
39
39
|
You might be interested in [dotenv-rails][3] to set up those in development.
|
40
40
|
|
41
|
+
Also, you may specify which client to use as a configuration option, which is useful
|
42
|
+
when having to reauthenticate utilizing oauth.
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
ActiveForce.sfdc_client = Restforce.new()
|
46
|
+
oauth_token: current_user.oauth_token,
|
47
|
+
refresh_token: current_user.refresh_token,
|
48
|
+
instance_url: current_user.instance_url,
|
49
|
+
client_id: SALESFORCE_CLIENT_ID,
|
50
|
+
client_secret: SALESFORCE_CLIENT_SECRET
|
51
|
+
)
|
52
|
+
```
|
53
|
+
|
41
54
|
## Usage
|
42
55
|
|
43
56
|
```ruby
|
@@ -47,6 +60,14 @@ class Medication < ActiveForce::SObject
|
|
47
60
|
|
48
61
|
field :max_dossage # defaults to "Max_Dossage__c"
|
49
62
|
field :updated_from
|
63
|
+
|
64
|
+
##
|
65
|
+
# You can cast field value using `as`
|
66
|
+
# field :address_primary_active, from: 's360a__AddressPrimaryActive__c', as: :boolean
|
67
|
+
#
|
68
|
+
# Available options are :boolean, :int, :double, :percent, :date, :datetime, :string, :base64,
|
69
|
+
# :byte, :ID, :reference, :currency, :textarea, :phone, :url, :email, :combobox, :picklist,
|
70
|
+
# :multipicklist, :anyType, :location
|
50
71
|
|
51
72
|
##
|
52
73
|
# Table name is inferred from class name.
|
@@ -97,7 +118,7 @@ class Account < ActiveForce::SObject
|
|
97
118
|
|
98
119
|
has_many :today_log_entries,
|
99
120
|
model: DailyLogEntry,
|
100
|
-
scoped_as: ->{ where(date: Time.now.in_time_zone.strftime("%Y-%m-%d") }
|
121
|
+
scoped_as: ->{ where(date: Time.now.in_time_zone.strftime("%Y-%m-%d")) }
|
101
122
|
|
102
123
|
has_many :labs,
|
103
124
|
scoped_as: ->{ where("Category__c = 'EMR' AND Date__c <> NULL").order('Date__c DESC') }
|
data/lib/active_force.rb
CHANGED
data/lib/active_force/sobject.rb
CHANGED
data/lib/active_force/version.rb
CHANGED
@@ -5,7 +5,7 @@ describe ActiveForce::SObject do
|
|
5
5
|
let(:client) { double 'Client' }
|
6
6
|
|
7
7
|
before do
|
8
|
-
|
8
|
+
ActiveForce.sfdc_client = client
|
9
9
|
end
|
10
10
|
|
11
11
|
describe ".new" do
|
@@ -264,7 +264,7 @@ describe ActiveForce::SObject do
|
|
264
264
|
let(:territory){ Territory.new(id: '1', quota_id: '1') }
|
265
265
|
|
266
266
|
before do
|
267
|
-
|
267
|
+
ActiveForce.sfdc_client = client
|
268
268
|
end
|
269
269
|
|
270
270
|
it 'clears cached associations' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_force
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Espinaco
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-10-
|
14
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: active_attr
|
@@ -192,3 +192,4 @@ test_files:
|
|
192
192
|
- spec/support/restforce_factories.rb
|
193
193
|
- spec/support/sobjects.rb
|
194
194
|
- spec/support/whizbang.rb
|
195
|
+
has_rdoc:
|