prismic.io 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/prismic/api.rb +4 -3
- data/lib/prismic/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: c7f2d0b0ba3d6766562edf42e7538f6ea33511a4
|
4
|
+
data.tar.gz: a372c1dcdcfd3e4c45309335b6ead48a1e40b390
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4405dddff6efff77e345c58fbe95f3487d6ff5654526a2e2c855e89f8198f38792b11f07e2a881404b196b22027177f062377774de7322508323f2a6ff71fa9
|
7
|
+
data.tar.gz: e72e6fbd322acfb9d635b1339b24dc265769bb3cafe7d4774359722cbf668612c8a5b5e91688c1958c47fd6593f5a12ef0e97e50b4c517aad3723dd6b300dbd7
|
data/Gemfile.lock
CHANGED
data/lib/prismic/api.rb
CHANGED
@@ -105,9 +105,10 @@ module Prismic
|
|
105
105
|
def preview_session(token, link_resolver, default_url)
|
106
106
|
response = self.http_client.get(token, {}, 'Accept' => 'application/json')
|
107
107
|
if response.code.to_s == '200'
|
108
|
-
|
109
|
-
|
110
|
-
|
108
|
+
json = JSON.load(response.body)
|
109
|
+
documents = self.form('everything').query(Prismic::Predicates.at('document.id', json['mainDocument'])).submit(token)
|
110
|
+
if documents.results.size > 0
|
111
|
+
link_resolver.link_to(documents.results[0])
|
111
112
|
else
|
112
113
|
default_url
|
113
114
|
end
|
data/lib/prismic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prismic.io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Étienne Vallette d'Osia
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-11-
|
14
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|