faceted_search 3.5.7 → 3.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/faceted_search/facets/date.rb +4 -1
- data/app/models/faceted_search/facets/default_list.rb +2 -1
- data/app/models/faceted_search/facets/primitive_list.rb +1 -1
- data/app/models/faceted_search/facets/text.rb +12 -1
- data/app/models/faceted_search/facets.rb +6 -1
- data/app/views/faceted_search/facets/checkboxes/_all.html.erb +1 -0
- data/app/views/faceted_search/facets/checkboxes/_selected.html.erb +1 -0
- data/app/views/faceted_search/facets/date/_all.html.erb +1 -0
- data/app/views/faceted_search/facets/date/_selected.html.erb +1 -0
- data/app/views/faceted_search/facets/full_tree/_all.html.erb +1 -0
- data/app/views/faceted_search/facets/full_tree/_selected.html.erb +1 -0
- data/app/views/faceted_search/facets/full_tree/_values-selected.html.erb +1 -0
- data/app/views/faceted_search/facets/full_tree/_values.html.erb +1 -0
- data/app/views/faceted_search/facets/list/_all.html.erb +1 -0
- data/app/views/faceted_search/facets/list/_selected.html.erb +1 -0
- data/app/views/faceted_search/facets/primitive_list/_all.html.erb +1 -0
- data/app/views/faceted_search/facets/range/_all.html.erb +1 -0
- data/app/views/faceted_search/facets/range/_selected.html.erb +1 -0
- data/app/views/faceted_search/facets/text/_all.html.erb +1 -0
- data/app/views/faceted_search/facets/text/_selected.html.erb +1 -0
- data/app/views/faceted_search/facets/tree/_all.html.erb +1 -0
- data/lib/faceted_search/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ada6583674e8af506d38ff4d6210031a2c26e36b272d81dcfcc294d771c11b8
|
4
|
+
data.tar.gz: c0ecb0db4418a381bdef93b05e1ea8f69a4b71dcb71c05cc04e5729cb0e41b24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5618af51815c11964bcf5e17247000c50856a440b30582451382067f3c987df98258b8eb18a2b2d2e08705038f2c508e440e71a377cda146797b60730943f74
|
7
|
+
data.tar.gz: f10e4f886e2097bc67175dd95f29af2afc817bd101f5e2f9e9617743068c736b6ceb908d2051d8085a841e37a6e55d8d2132f0119dee3f7d28fa3dae5d086b41
|
@@ -29,7 +29,8 @@ module FacetedSearch
|
|
29
29
|
@values ||= begin
|
30
30
|
joined_table = facets.model_table_name.to_sym
|
31
31
|
results = params_array.blank? ? facets.results : facets.results_except(@name)
|
32
|
-
source.all.joins(joined_table)
|
32
|
+
values = source.all.joins(joined_table)
|
33
|
+
values.where(joined_table => { id: results }).or(values.where(id: params_array)).distinct
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
@@ -8,7 +8,18 @@ module FacetedSearch
|
|
8
8
|
|
9
9
|
def add_scope(scope)
|
10
10
|
return scope if params.blank?
|
11
|
-
scope.where(
|
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
|
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.
|
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:
|
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.
|
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: []
|