File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 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
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
You can’t perform that action at this time.
0 commit comments