File tree 1 file changed +7
-15
lines changed
lib/wicked_pdf/wicked_pdf_helper
1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,6 @@ def initialize(url, response)
30
30
end
31
31
end
32
32
33
- class PropshaftAsset < SimpleDelegator
34
- def content_type
35
- super . to_s
36
- end
37
-
38
- def to_s
39
- content
40
- end
41
-
42
- def filename
43
- path . to_s
44
- end
45
- end
46
-
47
33
class SprocketsEnvironment
48
34
def self . instance
49
35
@instance ||= Sprockets ::Railtie . build_environment ( Rails . application )
@@ -74,6 +60,12 @@ def filename
74
60
end
75
61
end
76
62
63
+ class PropshaftAsset < LocalAsset
64
+ def to_s
65
+ Rails . application . assets . resolver . read ( path )
66
+ end
67
+ end
68
+
77
69
def wicked_pdf_asset_base64 ( path )
78
70
asset = find_asset ( path )
79
71
raise MissingLocalAsset , path if asset . nil?
@@ -202,7 +194,7 @@ def find_asset(path)
202
194
if Rails . application . assets . respond_to? ( :find_asset )
203
195
Rails . application . assets . find_asset ( path , :base_path => Rails . application . root . to_s )
204
196
elsif defined? ( Propshaft ::Assembly ) && Rails . application . assets . is_a? ( Propshaft ::Assembly )
205
- PropshaftAsset . new ( Rails . application . assets . load_path . find ( path ) )
197
+ PropshaftAsset . new ( path )
206
198
elsif Rails . application . respond_to? ( :assets_manifest )
207
199
relative_asset_path = get_asset_path_from_manifest ( path )
208
200
return unless relative_asset_path
You can’t perform that action at this time.
0 commit comments