File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 5
5
class WickedPdf
6
6
if defined? ( Rails . env )
7
7
8
- if Rails ::VERSION ::MAJOR >= 5
8
+ if Rails ::VERSION ::MAJOR >= 4
9
9
10
10
class WickedRailtie < Rails ::Railtie
11
11
initializer 'wicked_pdf.register' do |_app |
12
- ActionController ::Base . send :prepend , PdfHelper
13
- ActionView ::Base . send :include , WickedPdfHelper ::Assets
14
- end
15
- end
16
-
17
- elsif Rails ::VERSION ::MAJOR == 4
18
-
19
- class WickedRailtie < Rails ::Railtie
20
- initializer 'wicked_pdf.register' do |_app |
21
- ActionController ::Base . send :include , PdfHelper
12
+ if ActionController ::Base . respond_to? ( :prepend ) &&
13
+ Object . method ( :new ) . respond_to? ( :super_method )
14
+ ActionController ::Base . send :prepend , PdfHelper
15
+ else
16
+ ActionController ::Base . send :include , PdfHelper
17
+ end
22
18
ActionView ::Base . send :include , WickedPdfHelper ::Assets
23
19
end
24
20
end
You can’t perform that action at this time.
0 commit comments