alchemy-pg_search 4.1.0 → 4.2.0

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: 366fce3505557ca67b0a956441bc78e27c2bac492a8a008359571b2e768f2b18
4
- data.tar.gz: c30b0e00f6c8e6dbd32326fc569ee94aba2b2b9bf7acbfeb71ce0084c930f3f3
3
+ metadata.gz: b24390ba290061c913ce244c49cf38352d303bbd50e0855d2144517105ce6b53
4
+ data.tar.gz: 963ed8b25276155ce526186eb07b12b8d616b60df0d0d98100c713ed12eddc1c
5
5
  SHA512:
6
- metadata.gz: c43a3f9bc07488d00811cc028f0be916a92afe87836dfb6e5017d454fcd5da9cf361e220be56b063a9132ade82947491e909ea924c2b6762441ddfd065257c19
7
- data.tar.gz: 2c991f3476b1b82d960255d2f6d4d4adfd4610d6e93caa59bf8235326e485f2d4d36f0bcd16b0517472038e47e76835791cf7699c125aa5c3fc4c0eed8d91a5a
6
+ metadata.gz: 3acc723b3ae261ae52de6c1d59a6e2f727d870bb6849aa8ec461dd2eceaa8578cbc45df4562b5820316ff948210395921287b8391dc675ddaef8448012c980a9
7
+ data.tar.gz: b203d53773796999d6f04fd27c8834121e872f359342eeec9cf97737cd487ddae1505f3df8c5f3c83793d9b406ad13f7f88ca1d184d8b1bf72f0d5600c6eb4ea
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.2.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v4.2.0) (2023-01-23)
4
+
5
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v4.1.1...v4.2.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Update to Alchemy 6.1 [\#38](https://github.com/AlchemyCMS/alchemy-pg_search/pull/38) ([kulturbande](https://github.com/kulturbande))
10
+ - Page searchable toggle [\#37](https://github.com/AlchemyCMS/alchemy-pg_search/pull/37) ([kulturbande](https://github.com/kulturbande))
11
+
12
+ ## [v4.1.1](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v4.1.1) (2022-09-20)
13
+
14
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v4.1.0...v4.1.1)
15
+
16
+ **Merged pull requests:**
17
+
18
+ - Fix creating elements that has searchable defined [\#36](https://github.com/AlchemyCMS/alchemy-pg_search/pull/36) ([tvdeyen](https://github.com/tvdeyen))
19
+
3
20
  ## [v4.1.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v4.1.0) (2022-09-19)
4
21
 
5
22
  [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v4.0.0...v4.1.0)
@@ -14,44 +31,97 @@
14
31
  - Add multisearch configuration [\#34](https://github.com/AlchemyCMS/alchemy-pg_search/pull/34) ([kulturbande](https://github.com/kulturbande))
15
32
  - Remove old ferret upgrader [\#31](https://github.com/AlchemyCMS/alchemy-pg_search/pull/31) ([tvdeyen](https://github.com/tvdeyen))
16
33
 
17
- ## 4.0.0 (2022-08-30)
34
+ ## [v4.0.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v4.0.0) (2022-08-30)
35
+
36
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v3.0.0...v4.0.0)
18
37
 
19
- - Introduced new search module [#30](https://github.com/AlchemyCMS/alchemy-pg_search/pull/30) by [kulturbande](https://github.com/kulturbande)
20
- - Moved all extensions to a separate folder [#30](https://github.com/AlchemyCMS/alchemy-pg_search/pull/30) by [kulturbande](https://github.com/kulturbande)
21
- - Enable pg_search multisearch [#30](https://github.com/AlchemyCMS/alchemy-pg_search/pull/30) by [kulturbande](https://github.com/kulturbande)
22
- - Update Dummy App to Alchemy 6 [#30](https://github.com/AlchemyCMS/alchemy-pg_search/pull/30) by [kulturbande](https://github.com/kulturbande)
38
+ **Merged pull requests:**
39
+
40
+ - Alchemy 6 multi search [\#30](https://github.com/AlchemyCMS/alchemy-pg_search/pull/30) ([kulturbande](https://github.com/kulturbande))
41
+
42
+ ## [v3.0.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v3.0.0) (2022-07-01)
23
43
 
24
- ## 3.0.0 (2022-07-01)
44
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v2.4.0...v3.0.0)
25
45
 
26
- - Changed searchable option initialization [#29](https://github.com/AlchemyCMS/alchemy-pg_search/pull/29) by [kulturbande](https://github.com/kulturbande)
27
- - Remove Alchemy 4 support [#27](https://github.com/AlchemyCMS/alchemy-pg_search/pull/27) by [tvdeyen](https://github.com/tvdeyen)
46
+ **Merged pull requests:**
28
47
 
29
- ## 2.4.0 (2022-06-06)
48
+ - Fix initializing without element in attribute [\#29](https://github.com/AlchemyCMS/alchemy-pg_search/pull/29) ([kulturbande](https://github.com/kulturbande))
49
+ - Remove Alchemy 4 support [\#27](https://github.com/AlchemyCMS/alchemy-pg_search/pull/27) ([tvdeyen](https://github.com/tvdeyen))
30
50
 
31
- - Add support for Alchemy 5.2 [#25](https://github.com/AlchemyCMS/alchemy-pg_search/pull/25) by [kulturbande](https://github.com/kulturbande)
51
+ ## [v2.4.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v2.4.0) (2022-06-06)
32
52
 
33
- ## 2.3.0 (2022-03-04)
53
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v2.3.0...v2.4.0)
34
54
 
35
- - Add support for Alchemy 5.1 [#24](https://github.com/AlchemyCMS/alchemy-pg_search/pull/24) by [kulturbande](https://github.com/kulturbande)
55
+ **Merged pull requests:**
36
56
 
37
- ## 2.2.0 (2021-09-25)
57
+ - Switch to github actions [\#26](https://github.com/AlchemyCMS/alchemy-pg_search/pull/26) ([tvdeyen](https://github.com/tvdeyen))
58
+ - Add Alchemy 5.3 support [\#25](https://github.com/AlchemyCMS/alchemy-pg_search/pull/25) ([kulturbande](https://github.com/kulturbande))
38
59
 
39
- - Alchemy 4.3 [#21](https://github.com/AlchemyCMS/alchemy-pg_search/pull/21) by [tvdeyen](https://github.com/tvdeyen)
60
+ ## [v2.3.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v2.3.0) (2022-03-04)
40
61
 
41
- ## 2.1.0 (2021-09-25)
62
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v2.2.0...v2.3.0)
42
63
 
43
- - Do not allow Alchemy 4.3 and above [#22](https://github.com/AlchemyCMS/alchemy-pg_search/pull/22) by [tvdeyen](https://github.com/tvdeyen)
44
- - Add Rails 5.1 support [#19](https://github.com/AlchemyCMS/alchemy-pg_search/pull/19) by [tvdeyen](https://github.com/tvdeyen)
64
+ **Merged pull requests:**
65
+
66
+ - Update to Alchemy 5.1 [\#24](https://github.com/AlchemyCMS/alchemy-pg_search/pull/24) ([kulturbande](https://github.com/kulturbande))
67
+
68
+ ## [v2.2.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v2.2.0) (2021-09-25)
69
+
70
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v2.1.0...v2.2.0)
71
+
72
+ **Merged pull requests:**
73
+
74
+ - Alchemy 4.3 [\#21](https://github.com/AlchemyCMS/alchemy-pg_search/pull/21) ([tvdeyen](https://github.com/tvdeyen))
75
+
76
+ ## [v2.1.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v2.1.0) (2021-09-25)
77
+
78
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v2.0.0...v2.1.0)
79
+
80
+ **Merged pull requests:**
81
+
82
+ - Do not allow Alchemy 4.3 and above [\#22](https://github.com/AlchemyCMS/alchemy-pg_search/pull/22) ([tvdeyen](https://github.com/tvdeyen))
83
+ - Add Rails 5.1 support [\#19](https://github.com/AlchemyCMS/alchemy-pg_search/pull/19) ([tvdeyen](https://github.com/tvdeyen))
84
+
85
+ ## [v2.0.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v2.0.0) (2021-09-23)
86
+
87
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v1.2.0...v2.0.0)
88
+
89
+ **Closed issues:**
90
+
91
+ - Support for Alchemy 4 [\#12](https://github.com/AlchemyCMS/alchemy-pg_search/issues/12)
92
+
93
+ **Merged pull requests:**
94
+
95
+ - Move searchable attribute to contents table [\#20](https://github.com/AlchemyCMS/alchemy-pg_search/pull/20) ([tvdeyen](https://github.com/tvdeyen))
96
+ - Support Alchemy 4.0 [\#18](https://github.com/AlchemyCMS/alchemy-pg_search/pull/18) ([tvdeyen](https://github.com/tvdeyen))
97
+ - Remove test files from build gem [\#16](https://github.com/AlchemyCMS/alchemy-pg_search/pull/16) ([tvdeyen](https://github.com/tvdeyen))
98
+ - v1.2.0 [\#15](https://github.com/AlchemyCMS/alchemy-pg_search/pull/15) ([tvdeyen](https://github.com/tvdeyen))
99
+
100
+ ## [v1.2.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v1.2.0) (2018-11-28)
101
+
102
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v0.1.0...v1.2.0)
103
+
104
+ **Closed issues:**
105
+
106
+ - Can't generate view templates [\#7](https://github.com/AlchemyCMS/alchemy-pg_search/issues/7)
107
+ - error in combination with spree [\#1](https://github.com/AlchemyCMS/alchemy-pg_search/issues/1)
108
+
109
+ **Merged pull requests:**
45
110
 
46
- ## 2.0.0 (2021-09-23)
111
+ - Rename the \#search method into \#full\_text\_search [\#14](https://github.com/AlchemyCMS/alchemy-pg_search/pull/14) ([tvdeyen](https://github.com/tvdeyen))
112
+ - Search scope class [\#13](https://github.com/AlchemyCMS/alchemy-pg_search/pull/13) ([tvdeyen](https://github.com/tvdeyen))
113
+ - Configurable pagination [\#11](https://github.com/AlchemyCMS/alchemy-pg_search/pull/11) ([tvdeyen](https://github.com/tvdeyen))
114
+ - Nested elements support [\#10](https://github.com/AlchemyCMS/alchemy-pg_search/pull/10) ([tvdeyen](https://github.com/tvdeyen))
115
+ - Fix view template generator [\#9](https://github.com/AlchemyCMS/alchemy-pg_search/pull/9) ([wdspkr](https://github.com/wdspkr))
116
+ - Adjust alchemy page to new interface [\#8](https://github.com/AlchemyCMS/alchemy-pg_search/pull/8) ([wdspkr](https://github.com/wdspkr))
117
+ - Fix small typo in README [\#5](https://github.com/AlchemyCMS/alchemy-pg_search/pull/5) ([wdspkr](https://github.com/wdspkr))
118
+ - Remove executables line from gemspec [\#4](https://github.com/AlchemyCMS/alchemy-pg_search/pull/4) ([robinboening](https://github.com/robinboening))
119
+ - Alchemy 4 [\#3](https://github.com/AlchemyCMS/alchemy-pg_search/pull/3) ([tvdeyen](https://github.com/tvdeyen))
47
120
 
48
- - Move searchable attribute to contents table [#20](https://github.com/AlchemyCMS/alchemy-pg_search/pull/20) by [tvdeyen](https://github.com/tvdeyen)
49
- - Support Alchemy 4.0 [#18](https://github.com/AlchemyCMS/alchemy-pg_search/pull/18) by [tvdeyen](https://github.com/tvdeyen)
121
+ ## [v0.1.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v0.1.0) (2014-12-16)
50
122
 
51
- ## 1.2.0 (2018-11-28)
123
+ [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/ec23bf1d33f27d7ada9a2dd49922e4ae7740350d...v0.1.0)
52
124
 
53
- - Rename the #search method into #full_text_search [#14](https://github.com/AlchemyCMS/alchemy-pg_search/pull/14) by [tvdeyen](https://github.com/tvdeyen)
54
- - Add a page search scope class [#13](https://github.com/AlchemyCMS/alchemy-pg_search/pull/13) by [tvdeyen](https://github.com/tvdeyen)
55
125
 
56
126
 
57
127
  \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  gem "rails", "~> 6.0.0"
6
- ENV.fetch("ALCHEMY_BRANCH", "6.0-stable").tap do |branch|
6
+ ENV.fetch("ALCHEMY_BRANCH", "6.1-stable").tap do |branch|
7
7
  gem "alchemy_cms", github: "AlchemyCMS/alchemy_cms", branch: branch
8
8
  end
9
9
  gem "sassc-rails"
data/Rakefile CHANGED
@@ -51,7 +51,7 @@ namespace :changelog do
51
51
  GitHubChangelogGenerator::RakeTask.new :update do |config|
52
52
  config.user = "AlchemyCMS"
53
53
  config.project = "alchemy-pg_search"
54
- config.since_tag = "v4.0.0"
54
+ # config.since_tag = "v1.2.0"
55
55
  config.future_release = "v#{Alchemy::PgSearch::VERSION}"
56
56
  end
57
57
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_runtime_dependency "alchemy_cms", [">= 6.0", "< 7"]
19
+ spec.add_runtime_dependency "alchemy_cms", [">= 6.1", "< 7"]
20
20
  spec.add_runtime_dependency "pg_search", ["~> 2.1"]
21
21
  spec.add_runtime_dependency "pg"
22
22
 
@@ -70,11 +70,14 @@ module Alchemy
70
70
  end
71
71
 
72
72
  def search_result_page_layout
73
- page_layout = PageLayout.get_all_by_attributes(searchresults: true).first
74
- if page_layout.nil?
73
+ # search for page layout with the attribute `searchresults: true`
74
+ page_layouts = PageLayout.all.select do |page_layout|
75
+ page_layout.key?(:searchresults) && page_layout[:searchresults].to_s.casecmp(true.to_s).zero?
76
+ end
77
+ if page_layouts.nil?
75
78
  raise "No searchresults page layout found. Please add page layout with `searchresults: true` into your `page_layouts.yml` file."
76
79
  end
77
- page_layout
80
+ page_layouts.first
78
81
  end
79
82
 
80
83
  def paginate_per
@@ -1,7 +1,14 @@
1
1
  module Alchemy::PgSearch::ElementExtension
2
+ def self.prepended(base)
3
+ base.attr_writer :searchable
4
+ end
5
+
6
+ def searchable
7
+ definition.key?(:searchable) ? definition[:searchable] : true
8
+ end
9
+
2
10
  def searchable?
3
- (definition.key?(:searchable) ? definition[:searchable] : true) &&
4
- public? && page.searchable? && page_version.public?
11
+ searchable && public? && page.searchable? && page_version.public?
5
12
  end
6
13
  end
7
14
 
@@ -17,7 +17,7 @@ module Alchemy::PgSearch::PageExtension
17
17
 
18
18
  def searchable?
19
19
  (definition.key?(:searchable) ? definition[:searchable] : true) &&
20
- public? && !layoutpage?
20
+ searchable && public? && !layoutpage?
21
21
  end
22
22
 
23
23
  private
@@ -17,6 +17,9 @@ module Alchemy
17
17
  # reindex the page after it was published
18
18
  Alchemy.publish_targets << Alchemy::PgSearch::IndexPageJob
19
19
 
20
+ # enable searchable flag in page form
21
+ Alchemy.enable_searchable = true
22
+
20
23
  # configure multiselect to find also partial words
21
24
  # @link https://github.com/Casecommons/pg_search#searching-using-different-search-features
22
25
  ::PgSearch.multisearch_options = {
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
2
  module PgSearch
3
- VERSION = "4.1.0"
3
+ VERSION = "4.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-pg_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-19 00:00:00.000000000 Z
11
+ date: 2023-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alchemy_cms
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
19
+ version: '6.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '7'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '6.0'
29
+ version: '6.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '7'