will_paginate 3.1.3 → 3.1.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b9c92a0ce3f9e697334ea1bf11c0b57bdfd9fe2
|
4
|
+
data.tar.gz: b2794b2de86ceaa34f86d06f2c1952484b5409f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe7a7e48c35bda6cd6648f5243f3992ebe576f586afd5d140066fa05ecdd83862681245f44e554f5483e5dc4fe9f957e3b84b6208cc91a8e1dd1804c8593a49b
|
7
|
+
data.tar.gz: 5c388ced4fd0b8ad3da2ce6c5e9b2323b4cff1b950fdf3b35cc6e148b1e12509e8b6c0b83156b483d1a732ce4fe2497a4c09553b2650775cc922803699bf4347
|
@@ -38,9 +38,15 @@ module WillPaginate
|
|
38
38
|
alias_method :status_code, :status_code_with_paginate
|
39
39
|
end
|
40
40
|
def status_code_with_paginate(exception = @exception)
|
41
|
-
if exception.
|
42
|
-
|
43
|
-
|
41
|
+
actual_exception = if exception.respond_to?(:cause)
|
42
|
+
exception.cause
|
43
|
+
elsif exception.respond_to?(:original_exception)
|
44
|
+
exception.original_exception
|
45
|
+
else
|
46
|
+
exception
|
47
|
+
end
|
48
|
+
|
49
|
+
if actual_exception.is_a?(WillPaginate::InvalidPage)
|
44
50
|
Rack::Utils.status_code(:not_found)
|
45
51
|
else
|
46
52
|
original_method = method(:status_code_without_paginate)
|
@@ -41,10 +41,10 @@ module WillPaginate
|
|
41
41
|
protected
|
42
42
|
|
43
43
|
def page_number(page)
|
44
|
-
|
45
|
-
link(page, page, :rel => rel_value(page))
|
46
|
-
else
|
44
|
+
if page == current_page
|
47
45
|
tag(:em, page, :class => 'current')
|
46
|
+
else
|
47
|
+
link(page, page, :rel => rel_value(page))
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -108,9 +108,8 @@ module WillPaginate
|
|
108
108
|
|
109
109
|
def rel_value(page)
|
110
110
|
case page
|
111
|
-
when @collection.current_page - 1; 'prev'
|
111
|
+
when @collection.current_page - 1; 'prev'
|
112
112
|
when @collection.current_page + 1; 'next'
|
113
|
-
when 1; 'start'
|
114
113
|
end
|
115
114
|
end
|
116
115
|
|
@@ -30,7 +30,7 @@ module WillPaginate
|
|
30
30
|
window_from = current_page - inner_window
|
31
31
|
window_to = current_page + inner_window
|
32
32
|
|
33
|
-
# adjust lower or upper limit if
|
33
|
+
# adjust lower or upper limit if either is out of bounds
|
34
34
|
if window_to > total_pages
|
35
35
|
window_from -= window_to - total_pages
|
36
36
|
window_to = total_pages
|
@@ -80,9 +80,9 @@ describe WillPaginate::ActionView do
|
|
80
80
|
validate_page_numbers [1,1,3,3], elements
|
81
81
|
# test rel attribute values:
|
82
82
|
text(elements[0]).should == 'Prev'
|
83
|
-
elements[0]['rel'].should == 'prev
|
83
|
+
elements[0]['rel'].should == 'prev'
|
84
84
|
text(elements[1]).should == '1'
|
85
|
-
elements[1]['rel'].should == 'prev
|
85
|
+
elements[1]['rel'].should == 'prev'
|
86
86
|
text(elements[3]).should == 'Next'
|
87
87
|
elements[3]['rel'].should == 'next'
|
88
88
|
end
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mislav Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-15 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
|