Permalink
Browse files

AV Digestor correctly passes format to LookupContext

ActionView::Digestor now passes arguments correctly to
LookupContext::find method. This makes cache digests
respect the format option correctly.

FixtureFinder in tests also changed to reflect this.
  • Loading branch information...
1 parent 8aafb3d commit 9a79c13c45b34c8bf338d341a421badeb4815c94 @eimermusic eimermusic committed Apr 25, 2013
Showing with 11 additions and 2 deletions.
  1. +9 −0 actionpack/CHANGELOG.md
  2. +1 −1 actionpack/lib/action_view/digestor.rb
  3. +1 −1 actionpack/test/template/digestor_test.rb
@@ -1,5 +1,14 @@
## Rails 4.0.0 (unreleased) ##
+* Fix cache digests to respect the format of view files being looked up.
+ Digestor called LookupContext.find with the options as the wrong argument
+ causing the formats option to be ignored.
+
+ Caching article/show.pdf.erb now correctly digests any dependencies as
+ _partial.pdf.erb and not _partial.html.erb.
+
+ *Martin Westin*
+
* Return a 405 Method Not Allowed response when a request contains an unknown
HTTP method.
@@ -57,7 +57,7 @@ def partial?
end
def template
- @template ||= finder.find(logical_name, [], partial?, formats: [ format ])
+ @template ||= finder.find(logical_name, [], partial?, [], formats: [ format ])
end
def source
@@ -15,7 +15,7 @@ def initialize(template_path)
class FixtureFinder
FIXTURES_DIR = "#{File.dirname(__FILE__)}/../fixtures/digestor"
- def find(logical_name, keys, partial, options)
+ def find(logical_name, prefixes, partial, keys, options)
FixtureTemplate.new("digestor/#{partial ? logical_name.gsub(%r|/([^/]+)$|, '/_\1') : logical_name}.#{options[:formats].first}.erb")
end
end

0 comments on commit 9a79c13

Please sign in to comment.