faceted_search 3.5.9 → 3.5.12
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/primitive_list.rb +1 -2
- data/app/models/faceted_search/facets/text.rb +12 -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: 3701076f83d21846f5cc9a52cd74837b34dab72875285698c447bc8adf277c95
|
4
|
+
data.tar.gz: b52786bceca2f186bf7e0893d5cb8021465557b4bb4865c6407874850effb249
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72d6aeebd895a237584c702063e376f486480d349e776afdaa0a4c4732d6d11e9f1d0497a45182d1c2ad7a6351fccc52c126e0242a3a6fd7eea0a18b8ec83812
|
7
|
+
data.tar.gz: 633cb87e9a5d78d7efc271c610bab9d76693bb80d055f3cfcbe7a68a8d89e18c9e12bb9b2ca8a2f28fb1e0416cc5d41825270f1c40342e67f079671c90630f80
|
@@ -4,13 +4,12 @@ module FacetedSearch
|
|
4
4
|
def source
|
5
5
|
@source ||= begin
|
6
6
|
if @options[:source].present?
|
7
|
-
@options[:source]
|
7
|
+
@options[:source].where("#{field} IS NOT NULL")
|
8
8
|
else
|
9
9
|
results = params_array.compact.blank? ? facets.results : facets.results_except(@name)
|
10
10
|
results.send(:all).where("#{field} IS NOT NULL")
|
11
11
|
end
|
12
12
|
end
|
13
|
-
@options[:source].where("#{field} IS NOT NULL")
|
14
13
|
end
|
15
14
|
|
16
15
|
def order
|
@@ -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.12
|
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-27 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.
|
189
|
-
signing_key:
|
188
|
+
rubygems_version: 3.1.6
|
189
|
+
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Faceted search with Active Record
|
192
192
|
test_files: []
|