Skip to content

Commit 6879d32

Browse files
authored
We should substitute Rails related paths on files only
Related to #291
1 parent 42d7221 commit 6879d32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/overrides/premailer/premailer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def load_css_from_local_file!(path)
99
# Remove query string and the path
1010
clean_path = path.sub(/\?.*$/, '').sub(%r(^https?://[^/]*/), '')
1111
rails_path = Rails.root.join('public', clean_path)
12-
if File.exist?(rails_path)
12+
if File.file?(rails_path)
1313
load_css_from_string(File.read(rails_path))
1414
elsif (asset = Rails.application.assets.find_asset(clean_path.sub("#{Rails.configuration.assets.prefix}/", '')))
1515
load_css_from_string(asset.source)

0 commit comments

Comments
 (0)