api-pagination 4.5.0 → 4.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/api-pagination/hooks.rb +13 -11
- data/lib/api-pagination/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1593c1cca4de7e65dae45510075edbc44835c1d
|
4
|
+
data.tar.gz: 6d4b8192486631b97fd8d7cc2e9faa9a64e690a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4b2a4006bf64b31ef53bffc3fed788752c6f27865efb5c3ecbdf85d33fc6e8656cc2f72f9edf87972669d0e288d636f4930b4df35d607b77135dafd99d7f231
|
7
|
+
data.tar.gz: a53e3fb57f146a59456055c40ac56dab2ad51a548efde8e9c565973c7243eed2845f7c9152f50674e77b273c9ff15851c3c504549c3ff9fdb480140e9302e97d
|
data/lib/api-pagination/hooks.rb
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
begin; require 'rails'; rescue LoadError; end
|
2
2
|
begin; require 'rails-api'; rescue LoadError; end
|
3
|
+
|
3
4
|
if defined?(Rails)
|
5
|
+
module ApiPagination
|
6
|
+
module Hooks
|
7
|
+
def self.rails_parent_controller
|
8
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('5') || defined?(ActionController::API)
|
9
|
+
ActionController::API
|
10
|
+
else
|
11
|
+
ActionController::Base
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
4
17
|
require 'rails/pagination'
|
5
18
|
|
6
19
|
ActiveSupport.on_load(:action_controller) do
|
@@ -27,14 +40,3 @@ unless defined?(Kaminari) || defined?(WillPaginate::CollectionMethods)
|
|
27
40
|
WARNING
|
28
41
|
end
|
29
42
|
|
30
|
-
module ApiPagination
|
31
|
-
module Hooks
|
32
|
-
def self.rails_parent_controller
|
33
|
-
if Gem::Version.new(Rails.version) >= Gem::Version.new('5') || defined?(ActionController::API)
|
34
|
-
ActionController::API
|
35
|
-
else
|
36
|
-
ActionController::Base
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-pagination
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Celis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|