will_paginate 3.0.10 → 3.0.11

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: f89ac330d0bfe22322663e941baf5df56ae1665b
4
- data.tar.gz: 34c620179735243456d33d6c8e3ef598943c6ece
3
+ metadata.gz: aaded127564427ed76f61b5e0881544bd0a084e6
4
+ data.tar.gz: a1207de02008a0a66bca8645ecbdca4c35aec64d
5
5
  SHA512:
6
- metadata.gz: 59b1b5d2aeadabe9c32d93de3d53f6fbccbdfa7751b13aa31ddfc8dc8f2c982a69dabf0aff374c22aab231bc757f3a024666c8b9aef64828be72ee0aca928edf
7
- data.tar.gz: 5cb99c80812edb2092fad046dc4a326560122b4ef62145b776933da12df2520720dbbbb8313a558dc056ae6b2a7ad154d3c3dd86846307606c588772970d72ee
6
+ metadata.gz: 7de3a178b36b74c21a1c0760770be96f68662e580a74a8b40bc23e10374fbf83ab1f820e24a67d2a46aa6fe9fd42f5c2953df8569b11a142a9ee2e44a74428db
7
+ data.tar.gz: d4e29c4c113fbb3a4e17069026fdaf0abddc8a4ff506dfcb584c7d4320280109ebf5e9540726408ef19473cf9db7274d25de307469cc6842568d1ce487afbacc
@@ -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.is_a?(WillPaginate::InvalidPage) or
42
- (exception.respond_to?(:original_exception) &&
43
- exception.original_exception.is_a?(WillPaginate::InvalidPage))
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)
@@ -2,7 +2,7 @@ module WillPaginate #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- TINY = 10
5
+ TINY = 11
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  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.0.10
4
+ version: 3.0.11
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-09-21 00:00:00.000000000 Z
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