table-for 3.6.1 → 3.6.2

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
- SHA1:
3
- metadata.gz: a06e3f4c62b8e960ce23e069b5a9e988d0a36721
4
- data.tar.gz: eaf4a354271a193e83a835036dacd42cf4bc696a
2
+ SHA256:
3
+ metadata.gz: 0ed186963c980c1b8a756b21fb207d93817e6a1b09e0d39a5048af3cd44675bd
4
+ data.tar.gz: ea3427c27fcd27836a6d1902b8c13452f0fe545eac441305bb4503a12b1b208f
5
5
  SHA512:
6
- metadata.gz: 8d4d10c87846a31dcd086dcf266dab6e28f171c08190f69fa0e8e551015053c909663ab389ec4f9921ec0e00e66433f08cb6453228db1840d3e0a52f20786245
7
- data.tar.gz: 62dbeac5635056aeda4b3cf2dc33dbb0eda9f9b08491e19997588e6b1a900786981e5c2efdb638696315df04c93b7b903a73454f213a9c84afdbbfce153fbaf0
6
+ metadata.gz: 5aa25b5877ce491bbcdbab566bb05fe42b9cf204f587be3a380dce5244ea3d1a8d34220dd75ed2fb33f568329cf41e7abbc9a1d4f9fb1db49906ad773c27ee82
7
+ data.tar.gz: a29d3f3548725d57b84ba350c449be5d2afe10c012ef0bfadacfbc4f98e9ad65e9128770ce932cfc5a5d1dbaa1b161c2a5d48a281dbacbc3ba3647e8c964bf5e
@@ -0,0 +1,19 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 1.9.3
6
+ - 2.0.0
7
+ - 2.1.10
8
+ - 2.2.7
9
+ - 2.3.4
10
+ - 2.4.1
11
+
12
+ script: 'bundle exec rake'
13
+
14
+ notifications:
15
+ email:
16
+ recipients:
17
+ - hunterae@gmail.com
18
+ on_failure: change
19
+ on_success: never
@@ -1,3 +1,7 @@
1
+ 3.6.2
2
+ * Added :sort_modes option to be able to specify sort_modes on a column by column basis (thanks {karwank}[https://github.com/karwank])
3
+ * Fixed bug preventing action and controller from being removed in pagination link params in some versions of Rails (thanks {karwank}[https://github.com/karwank])
4
+
1
5
  3.6.1
2
6
  * Fixed :sortable option for Rails 5 that was breaking when
3
7
  ActionController::Parameters#to_query was being called without any arguments
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gemspec
3
+ gemspec
@@ -263,7 +263,7 @@ link_url::
263
263
  <% table.column :header => false,
264
264
  :data => "DELETE",
265
265
  :link_method => :DELETE,
266
- :link_url => lambda { admin_user_path(user) } %>
266
+ :link_url => lambda { |user| admin_user_path(user) } %>
267
267
  <% end %>
268
268
  link_action::
269
269
  (defaults to nil)
@@ -58,7 +58,7 @@ module TableFor
58
58
  if options[:sortable]
59
59
  order = options[:order] ? options[:order].to_s : column.name.to_s
60
60
 
61
- sort_modes = TableFor.config.sort_modes
61
+ sort_modes = options[:sort_modes].presence || TableFor.config.sort_modes
62
62
  current_sort_mode = (view.params[:order] != order || view.params[:sort_mode].blank?) ? nil : view.params[:sort_mode]
63
63
  current_sort_mode = sort_modes[sort_modes.index(current_sort_mode.to_sym)] rescue nil if current_sort_mode
64
64
  sort_class = "sorting#{"_#{current_sort_mode}" if current_sort_mode}"
@@ -105,7 +105,7 @@ module TableFor
105
105
  if options[:sortable] && (options[:header] || !column.anonymous)
106
106
  order = options[:order] ? options[:order].to_s : column.name.to_s
107
107
 
108
- sort_modes = TableFor.config.sort_modes
108
+ sort_modes = options[:sort_modes].presence || TableFor.config.sort_modes
109
109
  current_sort_mode = (view.params[:order] != order || view.params[:sort_mode].blank?) ? nil : view.params[:sort_mode]
110
110
  next_sort_mode_index = sort_modes.index(current_sort_mode.to_sym) + 1 rescue 0
111
111
  if next_sort_mode_index == sort_modes.length
@@ -115,11 +115,11 @@ module TableFor
115
115
  end
116
116
 
117
117
  parameters = view.params.merge(:order => order, :sort_mode => next_sort_mode)
118
+ parameters.delete(:action)
119
+ parameters.delete(:controller)
118
120
  if parameters.respond_to?(:to_unsafe_h)
119
121
  parameters = parameters.to_unsafe_h
120
122
  end
121
- parameters.delete(:action)
122
- parameters.delete(:controller)
123
123
  url = options[:sort_url] ? options[:sort_url] : ""
124
124
  view.link_to view.capture(self, &block), "#{url}?#{parameters.to_query}"
125
125
  else
@@ -1,3 +1,3 @@
1
1
  module TableFor
2
- VERSION = "3.6.1"
2
+ VERSION = "3.6.2"
3
3
  end
@@ -9,7 +9,6 @@ require 'xmlsimple'
9
9
  require 'active_record'
10
10
  require 'active_support/all'
11
11
  require 'with_model'
12
- require 'byebug'
13
12
 
14
13
  def print_hash(hash)
15
14
  hash.inject("") { |s, (k, v)| "#{s} #{k}: #{v}." }
@@ -27,6 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "supermodel"
28
28
  spec.add_development_dependency "sqlite3"
29
29
  spec.add_development_dependency "with_model"
30
- spec.add_development_dependency "byebug"
31
30
  spec.add_development_dependency "nokogiri"
32
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table-for
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.1
4
+ version: 3.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Hunter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-13 00:00:00.000000000 Z
11
+ date: 2019-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -122,20 +122,6 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: byebug
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: nokogiri
141
127
  requirement: !ruby/object:Gem::Requirement
@@ -160,6 +146,7 @@ extra_rdoc_files: []
160
146
  files:
161
147
  - ".byebug_history"
162
148
  - ".gitignore"
149
+ - ".travis.yml"
163
150
  - CHANGELOG.rdoc
164
151
  - Gemfile
165
152
  - Gemfile.lock
@@ -200,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
187
  version: '0'
201
188
  requirements: []
202
189
  rubyforge_project:
203
- rubygems_version: 2.4.8
190
+ rubygems_version: 2.7.8
204
191
  signing_key:
205
192
  specification_version: 4
206
193
  summary: table-for is a table builder for an array of objects, easily allowing overriding