effective_pages 3.7.2 → 3.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 609cb873f8ee7b06289d1b6a892e5dfdf31d331fec0e70524193966b8dae6fb5
|
4
|
+
data.tar.gz: e931912e980cf36b614deae0cf70f729f3e6e98fa78d6b415de4ccd5f13d687d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed4f370e424c4fa6d03146b15f2b15e67f747202009c4b264bad9b2fa1debc398a5fdb322ff4cabe1dc5fd7220bdd33a2effa4ccb4f72ee9df12be97695187f2
|
7
|
+
data.tar.gz: 5678d59ab27e06eb7320710462451917512e91f6c8010087dcea656b745f80442b5a4b9ca17f06d29f2818e910c32feaffc7dce464b7f76aad440e81ba4f3499
|
@@ -18,11 +18,11 @@ module ActsAsTagged
|
|
18
18
|
#
|
19
19
|
# Create or assign tags based on the input
|
20
20
|
#
|
21
|
-
# @param [Array<String, Integer>] input An array of tag names and/or tag ids, with
|
21
|
+
# @param [Array<String, Integer>] input An array of tag names and/or tag ids, with possible blank strings
|
22
22
|
#
|
23
23
|
# @return [void]
|
24
24
|
#
|
25
|
-
def
|
25
|
+
def tag_ids=(input) # named after the field name in `effective_pages/app/views/effective/tags/_fields.html.haml`
|
26
26
|
input = (input - ['']).group_by { |value| value.gsub(/\D/, '').to_i > 0 }
|
27
27
|
|
28
28
|
ids = (input[true] || []).map(&:to_i)
|
@@ -33,7 +33,7 @@ module ActsAsTagged
|
|
33
33
|
|
34
34
|
# Create any new Tags
|
35
35
|
ids.each do |tag_id|
|
36
|
-
taggings.find { |tagging| tagging.tag_id == tag_id } || self.tags << Effective::Tag.
|
36
|
+
taggings.find { |tagging| tagging.tag_id == tag_id } || self.tags << Effective::Tag.find(tag_id)
|
37
37
|
end
|
38
38
|
|
39
39
|
names.each { |name| self.tags.build(name: name) }
|
@@ -3,22 +3,11 @@ 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
|
-
}
|
6
|
+
multisearchable against: [:search_content]
|
21
7
|
|
8
|
+
def search_content
|
9
|
+
title + '|' + body.to_plain_text
|
10
|
+
end
|
22
11
|
end
|
23
12
|
|
24
13
|
attr_accessor :current_user
|
@@ -99,6 +88,22 @@ module Effective
|
|
99
88
|
published.where(menu: false).or(published.where(menu: true).where.not(id: menu_root_with_children))
|
100
89
|
}
|
101
90
|
|
91
|
+
scope :pages, -> (user: nil, unpublished: false) {
|
92
|
+
scope = all.deep.sorted
|
93
|
+
|
94
|
+
if defined?(EffectiveRoles) && EffectivePages.use_effective_roles
|
95
|
+
if user.present? && user.respond_to?(:roles)
|
96
|
+
scope = scope.for_role(user.roles)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
unless unpublished
|
101
|
+
scope = scope.published
|
102
|
+
end
|
103
|
+
|
104
|
+
scope
|
105
|
+
}
|
106
|
+
|
102
107
|
before_validation(if: -> { menu? && menu_position.blank? }) do
|
103
108
|
self.menu_position = (self.class.where(menu_parent: menu_parent).maximum(:menu_position) || -1) + 1
|
104
109
|
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.4
|
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-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|