index_for 0.3.3 → 0.3.4

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: a5ba163e0ba9541cb7f976e2a1bab589ec707124
4
- data.tar.gz: d0f92414f4741e43e8c489212ffe5c658a5c3ee1
3
+ metadata.gz: 26d75d92ddc4ff88a1c01e968ac8eb9dffe1febf
4
+ data.tar.gz: 46dacd22ad41d07eaa993dcb6645658aaf61e61d
5
5
  SHA512:
6
- metadata.gz: bbe6308df69896de306ededd2ccc51bc3d1d5442c676a44c45b95d69c9640f3d28f1dfc7c734910d05fbbb70ed5ed54a3ed78d2e911e5ca091a5670977190345
7
- data.tar.gz: 9d91c4e420c6d8f31c2ac60972da970af3d6f169143519235998168fe65b0f1d65744fb7818f6caea29143a57fe520e2d448f5caeec260d38b47b20a74cb6dbb
6
+ metadata.gz: 8a28d998a70a5be26ab3b92ffcbd418f195957d8ab524d6ebeda55e3b9d4294f6fe900325bde388d437f18d0ae142cc4675d0262f6e0965017643f4640ae02b8
7
+ data.tar.gz: 1407a496d1d763deb10932f24a6fbc0469b2f9b3ce47ea0dd2fcbaa43a55c03df2d0a0f80fd0df9d73e2c2e32e502925215cd53e566d9164da283abd33887049
@@ -16,10 +16,16 @@ module IndexFor
16
16
  "desc"
17
17
  end
18
18
 
19
+ sorting = params[:sortable] != false && options[:sortable] != false
20
+
19
21
  sorting_class = if order == params[:order]
20
22
  "sorting #{direction}"
21
- else
22
- "sorting" if params[:sortable] != false
23
+ elsif sorting
24
+ "sorting"
25
+ end
26
+
27
+ sorting_url = if sorting
28
+ @template.url_for(params.merge(order: order, direction: reverse_direction))
23
29
  end
24
30
 
25
31
  append_html_class options, attribute_class_name(attribute_name), sorting_class
@@ -28,7 +34,7 @@ module IndexFor
28
34
 
29
35
  options[:html] ||= {}
30
36
  options[:html][:data] ||= {}
31
- options[:html][:data][:href] = @template.url_for(params.merge(order: order, direction: reverse_direction))
37
+ options[:html][:data][:href] = sorting_url
32
38
 
33
39
  wrap_with :table_head_cell, attribute_label(attribute_name, options), options
34
40
  end
@@ -1,3 +1,3 @@
1
1
  module IndexFor
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: index_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-18 00:00:00.000000000 Z
11
+ date: 2020-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.4.8
154
+ rubygems_version: 2.6.14.4
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Wrap your objects with a helper to easily list them