will_paginate 3.1.6 → 3.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 990ad7af08e5c983697a5c1c679801e1641fe3fa
4
- data.tar.gz: be048d581649ca2a21e671ab46ea603a291ebff8
2
+ SHA256:
3
+ metadata.gz: 055de7646001b0cd954434778f9af8a291c9de7a13cf5f78e481b31d3df7a4a3
4
+ data.tar.gz: 93913a1dfbd702d8236c784eebea12bc8b26a06e79cacd7bb28205845eb861a2
5
5
  SHA512:
6
- metadata.gz: d5fda69cc13387b95b761efc5c697030cf36f41acbc87f513ed5eef5e629aaecab44e94a45150c4c236444d7a79c6653f446d12f4539f057f1789600682209c2
7
- data.tar.gz: 449283390fb84c7a91fb50fd007e1f9207024ef7a8ed16b28cd6887ee2f1b1ba5e9f8a4cb4e175fd44aa4298b45bbf5164cb45d63853faa0ccd2537768f1c269
6
+ metadata.gz: c27d39a4a1a1021f3b7fc1ef7e1e36e7611527c611cf8888f0844bcafefd93bc212429277ae979271c49f3bf2775402ff1d0ac2bbe4526dd1da578e171a3c3a8
7
+ data.tar.gz: 7f16947a5038e8d579519dbfd97a509a419e5ec7eb8cf35ae31b492bbfbcb0eb1e5ea128ce559008fd0759033c634f4555bc7f467d654f68a1938043c84f0838
data/README.md CHANGED
@@ -49,13 +49,12 @@ Post.where(:published => true).paginate(:page => params[:page]).order('id DESC')
49
49
  Post.page(params[:page]).order('created_at DESC')
50
50
  ```
51
51
 
52
- See [the wiki][wiki] for more documentation. [Ask on the group][group] if you have usage questions. [Report bugs][issues] on GitHub.
52
+ See [the wiki][wiki] for more documentation. [Report bugs][issues] on GitHub.
53
53
 
54
54
  Happy paginating.
55
55
 
56
56
 
57
57
  [wiki]: https://github.com/mislav/will_paginate/wiki
58
58
  [install]: https://github.com/mislav/will_paginate/wiki/Installation "will_paginate installation"
59
- [group]: http://groups.google.com/group/will_paginate "will_paginate discussion and support group"
60
59
  [issues]: https://github.com/mislav/will_paginate/issues
61
60
  [css]: http://mislav.github.io/will_paginate/
@@ -83,7 +83,10 @@ module WillPaginate
83
83
  excluded = [:order, :limit, :offset, :reorder]
84
84
  excluded << :includes unless eager_loading?
85
85
  rel = self.except(*excluded)
86
- column_name = (select_for_count(rel) || :all)
86
+ column_name = if rel.select_values.present?
87
+ select = rel.select_values.join(", ")
88
+ select if select !~ /[,*]/
89
+ end || :all
87
90
  rel.count(column_name)
88
91
  else
89
92
  super(*args)
@@ -136,13 +139,6 @@ module WillPaginate
136
139
  other.total_entries = nil if defined? @total_entries_queried
137
140
  other
138
141
  end
139
-
140
- def select_for_count(rel)
141
- if rel.select_values.present?
142
- select = rel.select_values.join(", ")
143
- select if select !~ /[,*]/
144
- end
145
- end
146
142
  end
147
143
 
148
144
  module Pagination
@@ -2,7 +2,7 @@ module WillPaginate #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- TINY = 6
5
+ TINY = 7
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -79,6 +79,13 @@ module ActiverecordTestConnector
79
79
  ActiveRecord::Base.configurations = { db => configuration }
80
80
  ActiveRecord::Base.establish_connection(db.to_sym)
81
81
  ActiveRecord::Base.default_timezone = :utc
82
+
83
+ case configuration['adapter']
84
+ when 'mysql'
85
+ fix_primary_key(ActiveRecord::ConnectionAdapters::MysqlAdapter)
86
+ when 'mysql2'
87
+ fix_primary_key(ActiveRecord::ConnectionAdapters::Mysql2Adapter)
88
+ end
82
89
  end
83
90
 
84
91
  def load_schema
@@ -90,7 +97,13 @@ module ActiverecordTestConnector
90
97
  $stdout = STDOUT
91
98
  end
92
99
  end
93
-
100
+
101
+ def fix_primary_key(adapter_class)
102
+ if ActiveRecord::VERSION::STRING < "4.1"
103
+ adapter_class::NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
104
+ end
105
+ end
106
+
94
107
  module FixtureSetup
95
108
  def fixtures(*tables)
96
109
  table_names = tables.map { |t| t.to_s }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.6
4
+ version: 3.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mislav Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-07 00:00:00.000000000 Z
11
+ date: 2019-03-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: will_paginate provides a simple API for performing paginated queries
14
14
  with Active Record, DataMapper and Sequel, and includes helpers for rendering pagination
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.4.5.1
103
+ rubygems_version: 2.7.6
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Pagination plugin for web frameworks and other apps