faceted_search 3.5.7 → 3.5.9

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: 80006422a406840a486d9c8f5a50e1a2425057b285af095e95ee359021a1c1d7
4
- data.tar.gz: 578682f035d0315fe84a4950e78879eb0f9654b5d9ff2582b091672473c517ff
3
+ metadata.gz: 265734657b1546de2a80bb631adf099b8758bedd7baf5f4af71a3c266cbf2547
4
+ data.tar.gz: 66f75f2e72f13bb7bb67b94d613c4597a866e8cba1c1f2dc789cbae542f851a8
5
5
  SHA512:
6
- metadata.gz: ee0870c176285f42f78bb0c244a52783dcc54733b1d0ad1fc5a3db88b069b72d0222bc2c87b6873fd1b503f5d5b2f58f6782c905963d38ece704ded9b5b21c0d
7
- data.tar.gz: f0f3ab3e4019737a2d48a364f74b82bc449a1d8d26f94972d3830dcf8334b61b2d473026832cec7d6247ac8bf88eb59e68f0e03237c6e30e54d88a091d199b5b
6
+ metadata.gz: de25113088db0880b13fa1aef84d86b03fe88572e54f334c7b2c7bcff4e6831a87d253c1cbb14f9483167ca5edc2ad041e34dbb8773aff732fd080ddc56fff58
7
+ data.tar.gz: e687d54f22dbb7d1b00a897268b07bb5a51de83a7980dbb1f190df105c381733f1f907031490b9da6cf3bd004867f45b9cc70dd42efb3c59cf251e084838b22d
@@ -53,7 +53,12 @@ module FacetedSearch
53
53
  end
54
54
 
55
55
  def has_params?
56
- params.values.select(&:present?).any?
56
+ any = false
57
+ list.each do |facet|
58
+ next if facet.hide_in_selected?
59
+ any = true if facet.params.present?
60
+ end
61
+ any
57
62
  end
58
63
 
59
64
  protected
@@ -26,7 +26,10 @@ module FacetedSearch
26
26
  end
27
27
 
28
28
  def values
29
- @values ||= order == :asc ? source : source.reverse
29
+ @values ||= begin
30
+ values = (source | params_array.map(&:to_i)).sort
31
+ order == :asc ? values : values.reverse
32
+ end
30
33
  end
31
34
  end
32
35
  end
@@ -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).where(joined_table => { id: results }).distinct
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
 
@@ -31,7 +31,7 @@ module FacetedSearch
31
31
 
32
32
  def values
33
33
  @values ||= begin
34
- values = source.pluck(field).uniq.reject(&:blank?).sort
34
+ values = (source.pluck(field).uniq.reject(&:blank?) | params_array.compact).sort
35
35
  order == :asc ? values : values.reverse
36
36
  end
37
37
  end
@@ -1,3 +1,3 @@
1
1
  module FacetedSearch
2
- VERSION = '3.5.7'
2
+ VERSION = '3.5.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faceted_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.7
4
+ version: 3.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Levy