effective_posts 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67d4f4c53d2b315bab9f9d64444fe9d7293a028c
|
4
|
+
data.tar.gz: c410bbe65c851e8cf3623aeb41391812deae99c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51c85c563406546e794d6c057fae118e8dd44ca4459f7b87ed8957e4e24cfef127942026606d650eafca829211c6ea4bb85cf338b3f92c3b6940484aa75e6a70
|
7
|
+
data.tar.gz: 12f20e77a16e05dda25596faf128d7c56b0af6de63ecb62471239c5c6f775aa2d7170da1f4678f2685eb634bb3efd35215e8e4766e32bef9191204e443912f7e
|
@@ -7,13 +7,10 @@ module Effective
|
|
7
7
|
def index
|
8
8
|
@posts = (Rails::VERSION::MAJOR > 3 ? Effective::Post.all : Effective::Post.scoped)
|
9
9
|
|
10
|
-
|
11
|
-
@posts = @posts.for_role(current_user.roles)
|
12
|
-
end
|
13
|
-
|
14
|
-
@posts = @posts.includes(:regions)
|
10
|
+
@posts = @posts.for_role(current_user.try(:roles)) if defined?(EffectiveRoles)
|
15
11
|
@posts = @posts.with_category(params[:category]) if params[:category]
|
16
12
|
@posts = @posts.published
|
13
|
+
@posts = @posts.includes(:regions)
|
17
14
|
|
18
15
|
@posts = @posts.order("#{EffectivePosts.posts_table_name}.published_at DESC")
|
19
16
|
@posts = @posts.page(params[:page]).per(EffectivePosts.per_page)
|
@@ -26,13 +23,10 @@ module Effective
|
|
26
23
|
def show
|
27
24
|
@posts = (Rails::VERSION::MAJOR > 3 ? Effective::Post.all : Effective::Post.scoped)
|
28
25
|
|
29
|
-
|
30
|
-
@posts = @posts.for_role(current_user.roles)
|
31
|
-
end
|
32
|
-
|
33
|
-
@posts = @posts.includes(:regions)
|
26
|
+
@posts = @posts.for_role(current_user.try(:roles)) if defined?(EffectiveRoles)
|
34
27
|
@posts = @posts.with_category(params[:category]) if params[:category]
|
35
28
|
@posts = @posts.published if params[:edit].to_s != 'true'
|
29
|
+
@posts = @posts.includes(:regions)
|
36
30
|
|
37
31
|
@post = @posts.find(params[:id])
|
38
32
|
|
@@ -25,7 +25,7 @@ EffectivePosts.setup do |config|
|
|
25
25
|
config.post_meta_author = true
|
26
26
|
|
27
27
|
# Use CanCan: authorize!(action, resource)
|
28
|
-
# Use effective_roles: resource.
|
28
|
+
# Use effective_roles: resource.roles_permit?(current_user)
|
29
29
|
config.authorization_method = Proc.new { |controller, action, resource| true }
|
30
30
|
|
31
31
|
# Layout Settings
|
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: 0.2.
|
4
|
+
version: 0.2.1
|
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: 2015-02-
|
11
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|