File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change
1
+ require "pathname"
2
+
1
3
# Naive fallback asset finder for when sprockets >= 3.0 &&
2
4
# config.assets.precompile = false
3
5
# Thanks to @ryanswood for the original code:
4
- # https://github.com/AbleHealth /inline_svg/commit/661bbb3bef7d1b4bd6ccd63f5f018305797b9509
6
+ # https://github.com/jamesmartin /inline_svg/commit/661bbb3bef7d1b4bd6ccd63f5f018305797b9509
5
7
module InlineSvg
6
8
class StaticAssetFinder
7
9
def self . find_asset ( filename )
@@ -14,7 +16,7 @@ def initialize(filename)
14
16
15
17
def pathname
16
18
if ::Rails . application . config . assets . compile
17
- ::Rails . application . assets [ @filename ] . pathname
19
+ Pathname . new ( ::Rails . application . assets [ @filename ] . filename )
18
20
else
19
21
manifest = ::Rails . application . assets_manifest
20
22
asset_path = manifest . assets [ @filename ]
You can’t perform that action at this time.
0 commit comments