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 +5 -5
- data/README.md +1 -2
- data/lib/will_paginate/active_record.rb +4 -8
- data/lib/will_paginate/version.rb +1 -1
- data/spec/finders/activerecord_test_connector.rb +14 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 055de7646001b0cd954434778f9af8a291c9de7a13cf5f78e481b31d3df7a4a3
|
|
4
|
+
data.tar.gz: 93913a1dfbd702d8236c784eebea12bc8b26a06e79cacd7bb28205845eb861a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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. [
|
|
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 =
|
|
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
|
|
@@ -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.
|
|
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:
|
|
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.
|
|
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
|