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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b86da7ae3b989602b2dcbd37699c80466901e16
4
- data.tar.gz: afd3024e01104aa310b23a4ac564fdd4c478c093
3
+ metadata.gz: f5447b1e3c33cdbec342bd888789a7ea139afb79
4
+ data.tar.gz: 2074db4f382bd51ba481bebbc7a96aff4cac1460
5
5
  SHA512:
6
- metadata.gz: 3ef1428c9e97396a80f8c2577c7290b201208c603e4ade01b045ed2499ea8c137bb3a1b015a272787bd52979ccb29207accd274ce13593fb7012745e7a6e8ce5
7
- data.tar.gz: 172f6758103dbea345a9bbd1ea67139fc4dff60da450a7c2285089ce528b452c67d80faa132add9a87ffd51ebf8ae4a34c4ec4259d4fb9b83a44d33cfd3095ea
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.genre
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
@@ -1,3 +1,3 @@
1
1
  module FortyFacets
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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: 2015-08-28 00:00:00.000000000 Z
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler