effective_pages 3.0.6 → 3.0.9

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: 6cf23b05e739f425ac9681d3a23482c0080498a59257e3e7f1988976e2807d3e
4
- data.tar.gz: 4504a432b1d2e2700aa351160ba73afe2ae9368f59aed98e00a5d0b3b30cb677
3
+ metadata.gz: 7451b8d10bc65dccbcc9d6927b5c76eaa917378b6725fd887e3509a7d39369fe
4
+ data.tar.gz: e0a7a32e358dd7009ba7f4801dd163422b67b653eb62037a06a6f97c4dcebe43
5
5
  SHA512:
6
- metadata.gz: 7ee1f64e3076dc7ca7e428d8d310881836b6ce24feeea8c310a20b7e1b582f60cb2a57992cb25f2d73ee8621f8424237b0cddc8e5c6292a10bb4041f1f005824
7
- data.tar.gz: 36137529002c0d6051ded641ee237a1e7419eb5a62364ab32718d30d7308dc5aa29d3b9a44746b07556cb99440fda95efe61b9b8fefa5875c2bb00cc0a706d4b
6
+ metadata.gz: ca28a3a998012976cfcef1773eac6f9d673ec22bcece7ab74fa2fd4812a9720de9b6648e05e1af1906d5ca80454910a0c0fb08d0e586cc2d606a748919887078
7
+ data.tar.gz: '0249e9d861efc9922fd998ce55685714e1f2890658b3b431a96d9c209a8133e19ccb6e4fddfc63d6f8d9da7c9f8bacc6fbf933aed2f51a65b08248c9399b247c'
@@ -59,8 +59,7 @@ module Effective
59
59
  validates :layout, presence: true
60
60
  validates :template, presence: true
61
61
 
62
- validates :menu_name, if: -> { menu? && EffectivePages.menus.present? },
63
- presence: true, inclusion: { in: EffectivePages.menus.map(&:to_s) }
62
+ validates :menu_name, if: -> { menu? && EffectivePages.menus.present? }, presence: true
64
63
 
65
64
  # validates :menu_position, if: -> { menu? },
66
65
  # presence: true, uniqueness: { scope: [:menu_name, :menu_parent_id] }
@@ -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]
@@ -1,3 +1,3 @@
1
1
  module EffectivePages
2
- VERSION = '3.0.6'.freeze
2
+ VERSION = '3.0.9'.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.6
4
+ version: 3.0.9
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-09-24 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails