faceted_search 3.5.10 → 3.5.11

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: f4d977f19f2132c5b2bd915b5e31b8994bc3a9cfea14e437abd71335e9ade21d
4
- data.tar.gz: ee426d8c2bc8db64d11e00ec0200e292c51fbd7d056267a3389ff4ad44d75f38
3
+ metadata.gz: 1ada6583674e8af506d38ff4d6210031a2c26e36b272d81dcfcc294d771c11b8
4
+ data.tar.gz: c0ecb0db4418a381bdef93b05e1ea8f69a4b71dcb71c05cc04e5729cb0e41b24
5
5
  SHA512:
6
- metadata.gz: f73ede5472a4581e99a3a0fa8b54bd65221cc2cc02ab24d12d692ee89570aa20e57dab1849f1f0b59cc3d37b27c7037cb0b4e6d21abc2f7f33f2e0253e29cf3b
7
- data.tar.gz: c38073518e0da2178cd5a4d7e431fb315a879b8e9446d12eedf80ba4c2318b06aced9541aa8381e073e16058656de81286c6ae638f24f1a532c44436f9121961
6
+ metadata.gz: c5618af51815c11964bcf5e17247000c50856a440b30582451382067f3c987df98258b8eb18a2b2d2e08705038f2c508e440e71a377cda146797b60730943f74
7
+ data.tar.gz: f10e4f886e2097bc67175dd95f29af2afc817bd101f5e2f9e9617743068c736b6ceb908d2051d8085a841e37a6e55d8d2132f0119dee3f7d28fa3dae5d086b41
@@ -8,7 +8,18 @@ module FacetedSearch
8
8
 
9
9
  def add_scope(scope)
10
10
  return scope if params.blank?
11
- scope.where("#{facets.model_table_name}.#{name} ILIKE ?", "%#{self.class.sanitize_sql_like(params)}%")
11
+ scope.where(where_condition, search_term: "%#{self.class.sanitize_sql_like(params)}%")
12
+ end
13
+
14
+ protected
15
+
16
+ def where_condition
17
+ # PostgreSQL handles removing accents if `unaccent` extension is enabled
18
+ if ActiveRecord::Base.connection.adapter_name == "PostgreSQL" && ActiveRecord::Base.connection.extensions.include?('unaccent')
19
+ "unaccent(#{facets.model_table_name}.#{name}) ILIKE unaccent(:search_term)"
20
+ else
21
+ "#{facets.model_table_name}.#{name} ILIKE :search_term"
22
+ end
12
23
  end
13
24
  end
14
25
  end
@@ -1,3 +1,3 @@
1
1
  module FacetedSearch
2
- VERSION = '3.5.10'
2
+ VERSION = '3.5.11'
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faceted_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.10
4
+ version: 3.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Levy
8
8
  - Sébastien Gaya
9
9
  - Sébastien Moulène
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-06-01 00:00:00.000000000 Z
13
+ date: 2022-04-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -170,7 +170,7 @@ homepage: http://github.com/lespoupeesrusses/faceted_search
170
170
  licenses:
171
171
  - MIT
172
172
  metadata: {}
173
- post_install_message:
173
+ post_install_message:
174
174
  rdoc_options: []
175
175
  require_paths:
176
176
  - lib
@@ -185,8 +185,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  requirements: []
188
- rubygems_version: 3.1.4
189
- signing_key:
188
+ rubygems_version: 3.3.7
189
+ signing_key:
190
190
  specification_version: 4
191
191
  summary: Faceted search with Active Record
192
192
  test_files: []