alchemy-pg_search 4.1.1 → 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: 828c2a8af31cad65403c88864ee11200cd85d0a9c45752b850aecddd045bde5d
4
- data.tar.gz: fb5848d9f666566521788b6c72439b436bfde28a44e3a097b6a0316ad7297d0d
3
+ metadata.gz: b24390ba290061c913ce244c49cf38352d303bbd50e0855d2144517105ce6b53
4
+ data.tar.gz: 963ed8b25276155ce526186eb07b12b8d616b60df0d0d98100c713ed12eddc1c
5
5
  SHA512:
6
- metadata.gz: 5476bef5b1fd765d8a1557c5c7530f3ec9c4261751054f02b2b73c2b3900d1252ade1bd27a642bef9cbc85fb6a54522ccf13274633e8af7f974ea587cfaea544
7
- data.tar.gz: 41c2a772efe484abec82ec3928fea14f8d1a86f2b703748c4f7223f66a56d8182a074b4430a541242b3ad15d9acde85e5d53e099987da7cad900f74f90a946dc
6
+ metadata.gz: 3acc723b3ae261ae52de6c1d59a6e2f727d870bb6849aa8ec461dd2eceaa8578cbc45df4562b5820316ff948210395921287b8391dc675ddaef8448012c980a9
7
+ data.tar.gz: b203d53773796999d6f04fd27c8834121e872f359342eeec9cf97737cd487ddae1505f3df8c5f3c83793d9b406ad13f7f88ca1d184d8b1bf72f0d5600c6eb4ea
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
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
+
3
12
  ## [v4.1.1](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v4.1.1) (2022-09-20)
4
13
 
5
14
  [Full Changelog](https://github.com/AlchemyCMS/alchemy-pg_search/compare/v4.1.0...v4.1.1)
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"
@@ -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
@@ -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.1"
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.1
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-20 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'