restforce-db 4.0.2 → 4.0.3
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/lib/restforce/db/cleaner.rb +5 -3
- data/lib/restforce/db/runner.rb +18 -4
- data/lib/restforce/db/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 222aeaddc4fb94b32a2b2eaacb3482762ede6c37
|
4
|
+
data.tar.gz: 46a1f5236ee978d5753432cbbf46aac25c32970e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20120c3a574b33d70d4794a6ac868452661cbd247a069ba3f0e480a16cc1e299ac7bae17067d10bcb9a387009b0fef66b99a8e8796f99711733d378ba9f220e0
|
7
|
+
data.tar.gz: 88161ce17126fe187092bbb8b006c4178eb946d30b7b7234084f1898f33b4e2638ca036875bb554c2b2e9bc4dc69d9a7587528d4d71da19698519efa7fdb3740
|
data/lib/restforce/db/cleaner.rb
CHANGED
@@ -113,7 +113,7 @@ module Restforce
|
|
113
113
|
#
|
114
114
|
# Returns an Array of IDs.
|
115
115
|
def all_salesforce_ids
|
116
|
-
@mapping.unscoped { salesforce_ids(@mapping) }
|
116
|
+
@mapping.unscoped { salesforce_ids(@mapping, false) }
|
117
117
|
end
|
118
118
|
|
119
119
|
# Internal: Get the IDs of the recently-modified Salesforce records for
|
@@ -128,11 +128,13 @@ module Restforce
|
|
128
128
|
# meet the conditions for this mapping.
|
129
129
|
#
|
130
130
|
# mapping - A Restforce::DB::Mapping.
|
131
|
+
# cached - A Boolean reflecting whether or not the collection should
|
132
|
+
# be cached.
|
131
133
|
#
|
132
134
|
# Returns an Array of IDs.
|
133
|
-
def salesforce_ids(mapping)
|
135
|
+
def salesforce_ids(mapping, cached = true)
|
134
136
|
@runner.run(mapping) do |run|
|
135
|
-
run.salesforce_instances.map(&:id)
|
137
|
+
run.salesforce_instances(cached).map(&:id)
|
136
138
|
end
|
137
139
|
end
|
138
140
|
|
data/lib/restforce/db/runner.rb
CHANGED
@@ -64,17 +64,31 @@ module Restforce
|
|
64
64
|
# Public: Iterate through recently-updated records for the Salesforce
|
65
65
|
# record type defined by the current mapping.
|
66
66
|
#
|
67
|
+
# cached - A Boolean reflecting whether or not the collection should be
|
68
|
+
# fetched through this runner's RecordCache.
|
69
|
+
#
|
67
70
|
# Returns an Enumerator yielding Restforce::DB::Instances::Salesforces.
|
68
|
-
def salesforce_instances
|
69
|
-
|
71
|
+
def salesforce_instances(cached = true)
|
72
|
+
if cached
|
73
|
+
@record_cache.collection(@mapping, :salesforce_record_type, options)
|
74
|
+
else
|
75
|
+
@mapping.salesforce_record_type.all(options)
|
76
|
+
end
|
70
77
|
end
|
71
78
|
|
72
79
|
# Public: Iterate through recently-updated records for the database model
|
73
80
|
# record type defined by the current mapping.
|
74
81
|
#
|
82
|
+
# cached - A Boolean reflecting whether or not the collection should be
|
83
|
+
# fetched through this runner's RecordCache.
|
84
|
+
#
|
75
85
|
# Returns an Enumerator yielding Restforce::DB::Instances::ActiveRecords.
|
76
|
-
def database_instances
|
77
|
-
|
86
|
+
def database_instances(cached = true)
|
87
|
+
if cached
|
88
|
+
@record_cache.collection(@mapping, :database_record_type, options)
|
89
|
+
else
|
90
|
+
@mapping.database_record_type.all(options)
|
91
|
+
end
|
78
92
|
end
|
79
93
|
|
80
94
|
private
|
data/lib/restforce/db/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restforce-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Horner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|