effective_pages 3.0.7 → 3.0.10

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
  SHA256:
3
- metadata.gz: edab6d11ae76db81b7c9805116c36cf24562346eff5cfab83df02f270a1e33cb
4
- data.tar.gz: d72f504d2563ab8e78e92dad9e7d85032c45b5694a5b23b77e8c77a17f24e98c
3
+ metadata.gz: ce5bc87bbf145bfcf88dfcf9b5efb9ab778876b4d103cc0a2b2cabfbae9f0f05
4
+ data.tar.gz: 613c1b974148fd8f0b31bcd204ce5cbd979545baf09d08468f9bb44f21ee4ab5
5
5
  SHA512:
6
- metadata.gz: c88a81eb833e0127f2001e5056a4da27e17206d9396fac46a513357b7d51894d5a308e5092e34ba69b7bab51c56ee5b8e5528fb80fe286c9939b2cb3969b3cdf
7
- data.tar.gz: a2042ed232554fa71b4dd7135ba5d14647105b33c634a736a2ed4059927825c607e9b084858a6785cd32a159a76323f9648410703999d7b16c08e537501e0207
6
+ metadata.gz: 51e0ba41ee3f97be0fe574b4cd017ba47fe3421e0d7827c0d1fad8522f4d1194ff8dc4e7c721c06d4d0b84b8414ba31a201ccea0ced2ae5dbc43148f1512b216
7
+ data.tar.gz: 7ff18a08e8d591bc473609244604b73bd8f24a42cccf579492db53d24fb536b7e6c460f36718ea35fa59693ba9aa437fab6806c02e6729565a4330d1cbaf4e42
@@ -4,7 +4,7 @@
4
4
  - Effective::Page.for_menu_root(menu).each do |page|
5
5
  - next unless EffectiveResources.authorized?(self, :show, page)
6
6
  - next if (page.authenticate_user || page.roles.present?) && current_user.blank?
7
- - next if page.roles.present? && !current_user.roles.include?(page.roles)
7
+ - next if page.roles.present? && (current_user.roles & page.roles).blank?
8
8
 
9
9
  - menu_children = page.menu_children.select { |page| page.menu_name == menu }
10
10
 
@@ -15,6 +15,6 @@
15
15
  - menu_children.each do |page|
16
16
  - next unless EffectiveResources.authorized?(self, :show, page)
17
17
  - next if (page.authenticate_user || page.roles.present?) && current_user.blank?
18
- - next if page.roles.present? && !current_user.roles.include?(page.roles)
18
+ - next if page.roles.present? && (current_user.roles & page.roles).blank?
19
19
 
20
20
  = nav_link_to((page.menu_title.presence || page.title), (page.menu_url.presence || effective_pages.page_path(page)))
data/config/routes.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  EffectivePages::Engine.routes.draw do
2
4
  namespace :admin do
3
5
  resources :pages, except: [:show]
@@ -4,9 +4,11 @@ module EffectivePages
4
4
 
5
5
  # Include Helpers to base application
6
6
  initializer 'effective_pages.action_controller' do |app|
7
- ActiveSupport.on_load :action_controller_base do
8
- helper EffectivePagesHelper
9
- helper EffectiveMenusHelper
7
+ app.config.to_prepare do
8
+ ActiveSupport.on_load :action_controller_base do
9
+ helper EffectivePagesHelper
10
+ helper EffectiveMenusHelper
11
+ end
10
12
  end
11
13
  end
12
14
 
@@ -1,3 +1,3 @@
1
1
  module EffectivePages
2
- VERSION = '3.0.7'.freeze
2
+ VERSION = '3.0.10'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 3.0.10
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: 2021-11-28 00:00:00.000000000 Z
11
+ date: 2022-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails