active_force 0.21.1 → 0.22.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 +7 -0
- data/lib/active_force/active_query.rb +4 -0
- data/lib/active_force/query.rb +4 -0
- data/lib/active_force/standard_types.rb +3 -2
- data/lib/active_force/version.rb +1 -1
- data/lib/generators/active_force/model/model_generator.rb +1 -1
- data/spec/active_force/active_query_spec.rb +14 -0
- data/spec/active_force/query_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c57b4dd00099e8df4236eeba3f7b917f0cef63f1cbe94a43a9f781633273d00e
|
4
|
+
data.tar.gz: ad72dce393fc4d40c869269eefe1c485cd5dcee7e556d9cf70c86036d775bcd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dc1dca5294187220f3998b0216854f8b793dd9f43669607f446136d0a375991dbd708eaacc192b5002c119530f5e4d492dd7e9fef6993b8aa0ca8f63e89efb0
|
7
|
+
data.tar.gz: 92c5ca6b3b5d99a0e1eccdc1c1b961e8dacad3b2d133f467ed17b3fce55211172b7a1402127d653054f824f54f596ada534ff3d0fd144c7b22a8ca68183d510d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
## Not released
|
4
4
|
|
5
|
+
## 0.22.1
|
6
|
+
- Fixes #94. Moved query logic and corrected ActiveQuery `ids` method (https://github.com/Beyond-Finance/active_force/pull/97)
|
7
|
+
|
8
|
+
## 0.22.0
|
9
|
+
- Add `ids` method to ActiveQuery interface (https://github.com/Beyond-Finance/active_force/pull/94)
|
10
|
+
- Add missing standard type for ContentNote and fix the way the model generator handles the name input so it acts a bit more predictably. (https://github.com/Beyond-Finance/active_force/pull/95)
|
11
|
+
|
5
12
|
## 0.21.1
|
6
13
|
- Fixes #91. Applies scopes to eager-loaded associations when they are nested. (https://github.com/Beyond-Finance/active_force/pull/92)
|
7
14
|
|
data/lib/active_force/query.rb
CHANGED
@@ -107,6 +107,10 @@ module ActiveForce
|
|
107
107
|
clone_and_set_instance_variables(query_fields: ["sum(#{field})"])
|
108
108
|
end
|
109
109
|
|
110
|
+
def ids
|
111
|
+
clone_and_set_instance_variables(query_fields: ["Id"])
|
112
|
+
end
|
113
|
+
|
110
114
|
protected
|
111
115
|
def and_conditions
|
112
116
|
"(#{@conditions.join(') AND (')})" unless @conditions.empty?
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module StandardTypes
|
2
|
-
STANDARD_TYPES = %w[
|
2
|
+
STANDARD_TYPES = %w[
|
3
3
|
Account
|
4
4
|
Asset
|
5
5
|
AssetFeed
|
@@ -67,6 +67,7 @@ module StandardTypes
|
|
67
67
|
ContentDocumentFeed
|
68
68
|
ContentDocumentHistory
|
69
69
|
ContentDocumentLink
|
70
|
+
ContentNote
|
70
71
|
ContentVersion
|
71
72
|
ContentVersionHistory
|
72
73
|
ContentWorkspace
|
@@ -352,6 +353,6 @@ module StandardTypes
|
|
352
353
|
WorkRewardHistory
|
353
354
|
WorkRewardShare
|
354
355
|
WorkThanks
|
355
|
-
WorkThanksShare
|
356
|
+
WorkThanksShare
|
356
357
|
]
|
357
358
|
end
|
data/lib/active_force/version.rb
CHANGED
@@ -16,7 +16,7 @@ module ActiveForce
|
|
16
16
|
}
|
17
17
|
|
18
18
|
def create_model_file
|
19
|
-
@table_name =
|
19
|
+
@table_name = name
|
20
20
|
@class_name = prepare_namespace + @table_name.gsub('__c', '')
|
21
21
|
template "model.rb.erb", "app/models/#{@class_name.underscore}.rb" if table_exists?
|
22
22
|
end
|
@@ -571,4 +571,18 @@ describe ActiveForce::ActiveQuery do
|
|
571
571
|
expect(active_query.first.id).to eq("0000000000AAAAABBB")
|
572
572
|
end
|
573
573
|
end
|
574
|
+
|
575
|
+
describe "#ids" do
|
576
|
+
before do
|
577
|
+
allow(client).to receive(:query).and_return(api_result)
|
578
|
+
api_result.each do |instance|
|
579
|
+
allow(active_query).to receive(:build).with(instance, {}).and_return(build_restforce_sobject(id: instance['Id']))
|
580
|
+
end
|
581
|
+
end
|
582
|
+
|
583
|
+
it "should return an array of id strings" do
|
584
|
+
expect(active_query.ids).to be_a Array
|
585
|
+
expect(active_query.ids).to eq api_result.map { |r| r['Id'] }
|
586
|
+
end
|
587
|
+
end
|
574
588
|
end
|
@@ -236,4 +236,14 @@ describe ActiveForce::Query do
|
|
236
236
|
expect(query.where("name = 'cool'").sum(:field1).to_s).to eq "SELECT sum(field1) FROM table_name WHERE (name = 'cool')"
|
237
237
|
end
|
238
238
|
end
|
239
|
+
|
240
|
+
describe ".ids" do
|
241
|
+
it "should return the query for selecting Id" do
|
242
|
+
expect(query.ids.to_s).to eq 'SELECT Id FROM table_name'
|
243
|
+
end
|
244
|
+
|
245
|
+
it "should work with a condition" do
|
246
|
+
expect(query.where("name = 'cool'").ids.to_s).to eq "SELECT Id FROM table_name WHERE (name = 'cool')"
|
247
|
+
end
|
248
|
+
end
|
239
249
|
end
|
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.
|
4
|
+
version: 0.22.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: 2024-
|
14
|
+
date: 2024-07-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activemodel
|