1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Log the full path, including variant, that the digestor is trying to find

This commit is contained in:
David Heinemeier Hansson 2014-03-19 20:51:13 +01:00
parent 06b4f01fca
commit 4bca34750d

View file

@ -75,20 +75,21 @@ module ActionView
end end
end end
attr_reader :name, :format, :variant, :finder, :options attr_reader :name, :format, :variant, :path, :finder, :options
def initialize(options_or_deprecated_name, *deprecated_args) def initialize(options_or_deprecated_name, *deprecated_args)
options = self.class._options_for_digest(options_or_deprecated_name, *deprecated_args) options = self.class._options_for_digest(options_or_deprecated_name, *deprecated_args)
@options = options.except(:name, :format, :variant, :finder) @options = options.except(:name, :format, :variant, :finder)
@name, @format, @variant, @finder = options.values_at(:name, :format, :variant, :finder) @name, @format, @variant, @finder = options.values_at(:name, :format, :variant, :finder)
@path = "#{@name}.#{format}".tap { |path| path << "+#{@variant}" if @variant }
end end
def digest def digest
Digest::MD5.hexdigest("#{source}-#{dependency_digest}").tap do |digest| Digest::MD5.hexdigest("#{source}-#{dependency_digest}").tap do |digest|
logger.try :info, "Cache digest for #{name}.#{format}: #{digest}" logger.try :info, "Cache digest for #{path}: #{digest}"
end end
rescue ActionView::MissingTemplate rescue ActionView::MissingTemplate
logger.try :error, "Couldn't find template for digesting: #{name}.#{format}" logger.try :error, "Couldn't find template for digesting: #{path}"
'' ''
end end