pulitzer 0.15.5 → 0.15.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pulitzer/controller_helpers.rb +4 -4
- data/lib/pulitzer/version.rb +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: b582418ef40475700755fdefb0fdd07618501f30
|
4
|
+
data.tar.gz: 0627f3b171f3933f74ea37bc46f61724a9bb3df1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64b62fb7fe3d4d2c2c0282fadef2a6aadadcd9ac2742d22553aae1b033681328101c8cf08222de70f465656aa63e297a9f196c0c2fb2e9f590a98605f40470a6
|
7
|
+
data.tar.gz: 61cb8669129318f91dfbff5ee1535a3678f891a34cb7a6b0d9ae495c832b98578645b29b6e52b385d5bd4c161347de98224c41e98d9e29941d5515cad36f4807
|
@@ -8,19 +8,19 @@ module Pulitzer
|
|
8
8
|
|
9
9
|
def get_active_post(post_type_name)
|
10
10
|
@post_type_version = Pulitzer::PostType.named(post_type_name).published_type_version
|
11
|
-
@post = get_post_for_version(@post_type_version)
|
11
|
+
@post = get_post_for_version(@post_type_version,:active)
|
12
12
|
return @post, @post_type_version
|
13
13
|
end
|
14
14
|
|
15
15
|
def get_preview_post(post_type_name)
|
16
16
|
@post_type_version = Pulitzer::PostType.named(post_type_name).post_type_versions.find_by(version_number: params[:version_number])
|
17
|
-
@post = get_post_for_version(@post_type_version)
|
17
|
+
@post = get_post_for_version(@post_type_version,:preview)
|
18
18
|
return @post, @post_type_version
|
19
19
|
end
|
20
20
|
|
21
|
-
def get_post_for_version(ptv)
|
21
|
+
def get_post_for_version(ptv,status)
|
22
22
|
if ptv.plural?
|
23
|
-
ptv.posts.find_by!(slug: params[:slug]).
|
23
|
+
ptv.posts.find_by!(slug: params[:slug]).send "get_#{status}_version!"
|
24
24
|
else
|
25
25
|
ptv.singleton_post.get_active_version!
|
26
26
|
end
|
data/lib/pulitzer/version.rb
CHANGED