effective_posts 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/effective/posts_controller.rb +12 -3
- data/lib/effective_posts/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ecb4b57c498f35d22abd5e74e340a831a8e8a94087bf4e76add868e3303563a
|
4
|
+
data.tar.gz: b80111cb9a61dbe0fc84d2c38bb2650aff3a9c375cec6b15f7a21570d8da8570
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a0159505c082df7520b35d20bd096d2cbd6ad07e781bbf2a65f3ef8c87b16bf2f2227f89af7b7855e01f974d2ca63e8784b6a00e1bcb24709bdc948ee9b637b
|
7
|
+
data.tar.gz: e07f7a9e80b4b1cd31577cfa02624086d40808590ceca6298755d534d95162d10ace9a2f3269c8875cfcce39b3de3ec2348fbdf06f06727231af1c27b1aa9711
|
@@ -7,8 +7,8 @@ module Effective
|
|
7
7
|
|
8
8
|
def index
|
9
9
|
@posts ||= Effective::Post.posts(
|
10
|
-
user: current_user,
|
11
|
-
category: params[:category],
|
10
|
+
user: current_user,
|
11
|
+
category: params[:category],
|
12
12
|
unpublished: EffectivePosts.authorized?(self, :admin, :effective_posts)
|
13
13
|
)
|
14
14
|
|
@@ -25,13 +25,21 @@ module Effective
|
|
25
25
|
|
26
26
|
EffectivePosts.authorize!(self, :index, Effective::Post)
|
27
27
|
|
28
|
-
|
28
|
+
if params[:page]
|
29
|
+
@page_title ||= ((params[:category].presence || 'Blog').titleize + " - Page #{params[:page].to_s}")
|
30
|
+
@canonical_url ||= effective_posts.posts_url(page: params[:page])
|
31
|
+
else
|
32
|
+
@page_title ||= (params[:category].presence || 'Blog').titleize
|
33
|
+
@canonical_url ||= effective_posts.posts_url
|
34
|
+
end
|
35
|
+
|
29
36
|
end
|
30
37
|
|
31
38
|
def show
|
32
39
|
@posts ||= Effective::Post.posts(user: current_user, category: params[:category], unpublished: EffectivePosts.authorized?(self, :admin, :effective_posts))
|
33
40
|
@post = @posts.find(params[:id])
|
34
41
|
|
42
|
+
|
35
43
|
if @post.respond_to?(:roles_permit?)
|
36
44
|
raise Effective::AccessDenied.new('Access Denied', :show, @post) unless @post.roles_permit?(current_user)
|
37
45
|
end
|
@@ -50,6 +58,7 @@ module Effective
|
|
50
58
|
|
51
59
|
@page_title ||= @post.title
|
52
60
|
@meta_description ||= @post.description
|
61
|
+
@canonical_url ||= effective_posts.post_url(@post)
|
53
62
|
end
|
54
63
|
|
55
64
|
# Public user submit a post functionality
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_posts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|