aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-01-18 01:49:15 -0500
committerGitHub <noreply@github.com>2017-01-18 01:49:15 -0500
commit12634786967da966b74b89b10c9790d7eae6874d (patch)
treeaf160861222105a629ac343204c41df18485ae60 /actionview
parenta4dbbde4c91a52e28b6c4772b0032b9c16d636ca (diff)
parent35787a3d06875648dcc536d540f8fbfc818d809f (diff)
downloadrails-12634786967da966b74b89b10c9790d7eae6874d.tar.gz
rails-12634786967da966b74b89b10c9790d7eae6874d.tar.bz2
rails-12634786967da966b74b89b10c9790d7eae6874d.zip
Merge pull request #27665 from kenta-s/improve-compute_asset_extname
compute_asset_extname should explicitly return nil in else clause
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/asset_url_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb
index bdabaed85c..03bd1eb008 100644
--- a/actionview/lib/action_view/helpers/asset_url_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_url_helper.rb
@@ -237,7 +237,11 @@ module ActionView
def compute_asset_extname(source, options = {})
return if options[:extname] == false
extname = options[:extname] || ASSET_EXTENSIONS[options[:type]]
- extname if extname && File.extname(source) != extname
+ if extname && File.extname(source) != extname
+ extname
+ else
+ nil
+ end
end
# Maps asset types to public directory.