effective_pages 3.7.2 → 3.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/page.rb +17 -16
- data/app/models/effective/permalink.rb +6 -0
- data/lib/effective_pages/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: 70925d39994d0941e75bece5c0b240134d2b32470d31199c513a2e25faddc840
|
4
|
+
data.tar.gz: 6c8effd26cf0f030a293adb9c1542bd13fb3dd294e553544a23370d2ec6648f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a538fa3618b3b1faf92f7ca4e8dad13ce41656e1b4327c7ff14813c9760127bbec87f3bfae4c929ddbacd8ae7a2bd4f3cc236e31860203c5a97dc2d61d4cc7f
|
7
|
+
data.tar.gz: f69803876b65edbd994fc7056903520a81f26907fbc8131260188e2fadcc32c4d7b22c62dd4677b468d996690b6011263e6140c2193477a8b2de3e329c3df776
|
@@ -3,22 +3,7 @@ module Effective
|
|
3
3
|
if defined?(PgSearch)
|
4
4
|
include PgSearch::Model
|
5
5
|
|
6
|
-
multisearchable against: [
|
7
|
-
:title,
|
8
|
-
:menu_title,
|
9
|
-
:meta_description,
|
10
|
-
:slug,
|
11
|
-
],
|
12
|
-
associated_against: {
|
13
|
-
rich_texts: [:body],
|
14
|
-
},
|
15
|
-
using: {
|
16
|
-
trigram: {},
|
17
|
-
tsearch: {
|
18
|
-
highlight: true,
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
6
|
+
multisearchable against: [:title, :menu_title, :meta_description, :slug]
|
22
7
|
end
|
23
8
|
|
24
9
|
attr_accessor :current_user
|
@@ -99,6 +84,22 @@ module Effective
|
|
99
84
|
published.where(menu: false).or(published.where(menu: true).where.not(id: menu_root_with_children))
|
100
85
|
}
|
101
86
|
|
87
|
+
scope :pages, -> (user: nil, unpublished: false) {
|
88
|
+
scope = all.deep.sorted
|
89
|
+
|
90
|
+
if defined?(EffectiveRoles) && EffectivePages.use_effective_roles
|
91
|
+
if user.present? && user.respond_to?(:roles)
|
92
|
+
scope = scope.for_role(user.roles)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
unless unpublished
|
97
|
+
scope = scope.published
|
98
|
+
end
|
99
|
+
|
100
|
+
scope
|
101
|
+
}
|
102
|
+
|
102
103
|
before_validation(if: -> { menu? && menu_position.blank? }) do
|
103
104
|
self.menu_position = (self.class.where(menu_parent: menu_parent).maximum(:menu_position) || -1) + 1
|
104
105
|
end
|
@@ -1,5 +1,11 @@
|
|
1
1
|
module Effective
|
2
2
|
class Permalink < ApplicationRecord
|
3
|
+
if defined?(PgSearch)
|
4
|
+
include PgSearch::Model
|
5
|
+
|
6
|
+
multisearchable against: [:title, :summary]
|
7
|
+
end
|
8
|
+
|
3
9
|
self.table_name = (EffectivePages.permalinks_table_name || :permalinks).to_s
|
4
10
|
|
5
11
|
has_one_attached :attachment
|
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.7.
|
4
|
+
version: 3.7.3
|
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: 2023-06-
|
11
|
+
date: 2023-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|