middleman-dato 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dato/records_repo.rb +6 -5
- data/middleman-dato.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dca7469c1611f8ff110ff74a9f08acf037c56ae
|
4
|
+
data.tar.gz: 82095d692ef11ca19d54e5e6308cf245d0d358e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0ebc6cf2a290d19b8c2049ca11797b704c3e0cdbefbcddbcf079429e635e66e11d79cfe8869861aee07ab35e24e9836e220755e34dc590ce0e67cba453e3eed
|
7
|
+
data.tar.gz: 8d84ccdefb3be96fe5b4d35616841bfba2c996679b669d3fab473b8486845dced45fc989fa20728d203c79e465fd5bf6bef3561583c92d3f12e05ebcf6419aba
|
data/lib/dato/records_repo.rb
CHANGED
@@ -8,14 +8,13 @@ module Dato
|
|
8
8
|
def initialize(entities_repo)
|
9
9
|
@entities_repo = entities_repo
|
10
10
|
@collections_by_type = {}
|
11
|
+
@records_by_id = {}
|
11
12
|
|
12
|
-
|
13
|
+
build_cache!
|
13
14
|
end
|
14
15
|
|
15
16
|
def find(id)
|
16
|
-
|
17
|
-
record && record.id == id
|
18
|
-
end
|
17
|
+
@records_by_id[id]
|
19
18
|
end
|
20
19
|
|
21
20
|
def respond_to?(method, include_private = false)
|
@@ -37,7 +36,7 @@ module Dato
|
|
37
36
|
end
|
38
37
|
end
|
39
38
|
|
40
|
-
def
|
39
|
+
def build_cache!
|
41
40
|
content_type_entities.each do |content_type|
|
42
41
|
key, singleton = content_type_key(content_type)
|
43
42
|
@collections_by_type[key] = if singleton
|
@@ -56,6 +55,8 @@ module Dato
|
|
56
55
|
else
|
57
56
|
@collections_by_type[key].push record
|
58
57
|
end
|
58
|
+
|
59
|
+
@records_by_id[record.id] = record
|
59
60
|
end
|
60
61
|
end
|
61
62
|
|
data/middleman-dato.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'middleman-dato'
|
6
|
-
s.version = '0.5.
|
6
|
+
s.version = '0.5.7'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ['Stefano Verna']
|
9
9
|
s.email = ['s.verna@cantierecreativo.net']
|