forty_facets 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/forty_facets/facet_search.rb +8 -1
- data/lib/forty_facets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5447b1e3c33cdbec342bd888789a7ea139afb79
|
4
|
+
data.tar.gz: 2074db4f382bd51ba481bebbc7a96aff4cac1460
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daebd12e70e89e58ef2c08e31347c4bd355a2f4ed6cbbe71d11f0918743e057bfa9ef25f63c1c52985a05a2e6105130915c1b77770de7e7ba38d25d4e86bd5d1
|
7
|
+
data.tar.gz: fa90efde5686bde5c05de1341f30d76076edaa6eecb7d2512c970b2da8574c5a78d1e51f6b3922c0e50060982c0fcd2971e19e43a1f940c0624c0b7110341ef9
|
data/README.md
CHANGED
@@ -101,7 +101,7 @@ Use the search object to display further narrowing options to the user
|
|
101
101
|
%li= link_to genre.name, filter.remove(genre).path
|
102
102
|
%ul.selectable
|
103
103
|
- filter.facet.reject(&:selected).each do |facet_value|
|
104
|
-
- genre = facet_value.
|
104
|
+
- genre = facet_value.entity
|
105
105
|
%li
|
106
106
|
= link_to genre.name, filter.add(genre).path
|
107
107
|
%span.count= "(#{facet_value.count})"
|
@@ -124,6 +124,7 @@ module FortyFacets
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def wrapped_params
|
127
|
+
return {} if params.empty?
|
127
128
|
{ self.class.request_param_name => params }
|
128
129
|
end
|
129
130
|
|
@@ -137,6 +138,7 @@ module FortyFacets
|
|
137
138
|
end
|
138
139
|
|
139
140
|
def path
|
141
|
+
return nil if wrapped_params.empty?
|
140
142
|
'?' + wrapped_params.to_param
|
141
143
|
end
|
142
144
|
|
@@ -156,7 +158,12 @@ module FortyFacets
|
|
156
158
|
|
157
159
|
def request_to_search_params(request_params)
|
158
160
|
if request_params && request_params[self.class.request_param_name]
|
159
|
-
request_params[self.class.request_param_name]
|
161
|
+
should_be_hash = request_params[self.class.request_param_name]
|
162
|
+
if should_be_hash.is_a? Hash
|
163
|
+
should_be_hash
|
164
|
+
else
|
165
|
+
{}
|
166
|
+
end
|
160
167
|
else
|
161
168
|
{}
|
162
169
|
end
|
data/lib/forty_facets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forty_facets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Axel Tetzlaff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|