restforce-db 4.0.2 → 4.0.3

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: bd4dde354d9c3b7ff70878e1de3fc6cfaabb4bf5
4
- data.tar.gz: 6b6865ff96ea9d198961953f14a838549ac52a26
3
+ metadata.gz: 222aeaddc4fb94b32a2b2eaacb3482762ede6c37
4
+ data.tar.gz: 46a1f5236ee978d5753432cbbf46aac25c32970e
5
5
  SHA512:
6
- metadata.gz: 9a208fbb2745bb961e75c4ac8effd23d36952f93efe92bf2c5b2315b5b2a3ee94510d3a96e6e11e2e3b1288133b293232c214120044c06dedb3eb246221925b3
7
- data.tar.gz: 993379536dbaf267cfbfd4e5df518ea12bd94a0bfbf06af99bea8be5056b4bc487007bb0c386c59000239eb611bf64910b03eb5cd006d8cc8c66b670282807b4
6
+ metadata.gz: 20120c3a574b33d70d4794a6ac868452661cbd247a069ba3f0e480a16cc1e299ac7bae17067d10bcb9a387009b0fef66b99a8e8796f99711733d378ba9f220e0
7
+ data.tar.gz: 88161ce17126fe187092bbb8b006c4178eb946d30b7b7234084f1898f33b4e2638ca036875bb554c2b2e9bc4dc69d9a7587528d4d71da19698519efa7fdb3740
@@ -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
 
@@ -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
- @record_cache.collection(@mapping, :salesforce_record_type, options)
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
- @record_cache.collection(@mapping, :database_record_type, options)
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
@@ -3,7 +3,7 @@ module Restforce
3
3
  # :nodoc:
4
4
  module DB
5
5
 
6
- VERSION = "4.0.2"
6
+ VERSION = "4.0.3"
7
7
 
8
8
  end
9
9
 
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.2
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-08 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord