restforce-db 1.2.10 → 1.2.11
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/registry.rb +10 -5
- 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: 3ef5b6219a597b42b72c8c636c9c82c84d4bfe8b
|
4
|
+
data.tar.gz: 6e56a42dab74deb021bf98abc66f250a15d1d46d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b3b4d3b7e38cd796708903f8eae824d84e3be02dced8c877e67fd8b24b8d387c0b5cb841618fb86f7269993331067c82837dcfebcec97a548c2884214718514
|
7
|
+
data.tar.gz: 7bbeb680efe9b4b1839fb85825b3fa744c97e757442ed0da0814acfc94377ab8b6f3adf1397a356ea55adb104d66612ebac076c4edc127c7f446baf38b7cdcae
|
@@ -14,7 +14,7 @@ module Restforce
|
|
14
14
|
#
|
15
15
|
# Returns a Restforce::DB::Mapping.
|
16
16
|
def self.[](model)
|
17
|
-
|
17
|
+
collection[model]
|
18
18
|
end
|
19
19
|
|
20
20
|
# Public: Iterate through all registered Restforce::DB::Mappings.
|
@@ -22,7 +22,7 @@ module Restforce
|
|
22
22
|
# Yields one Mapping for each database-to-Salesforce mapping.
|
23
23
|
# Returns nothing.
|
24
24
|
def self.each
|
25
|
-
|
25
|
+
collection.each do |model, mappings|
|
26
26
|
# Since each mapping is inserted twice, we ignore the half which
|
27
27
|
# were inserted via Salesforce model names.
|
28
28
|
next unless model.is_a?(Class)
|
@@ -42,7 +42,7 @@ module Restforce
|
|
42
42
|
# Returns nothing.
|
43
43
|
def self.<<(mapping)
|
44
44
|
[mapping.database_model, mapping.salesforce_model].each do |model|
|
45
|
-
|
45
|
+
collection[model] << mapping
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -50,10 +50,15 @@ module Restforce
|
|
50
50
|
#
|
51
51
|
# Returns nothing.
|
52
52
|
def self.clean!
|
53
|
-
@collection =
|
53
|
+
@collection = nil
|
54
54
|
end
|
55
55
|
|
56
|
-
|
56
|
+
# Public: Get the collection of currently-registered mappings.
|
57
|
+
#
|
58
|
+
# Returns a Hash.
|
59
|
+
def self.collection
|
60
|
+
@collection ||= Hash.new { |h, k| h[k] = [] }
|
61
|
+
end
|
57
62
|
|
58
63
|
end
|
59
64
|
|
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: 1.2.
|
4
|
+
version: 1.2.11
|
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-05-
|
11
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|