diff options
author | Martin Westin <martin@eimermusic.com> | 2013-04-25 09:37:46 +0200 |
---|---|---|
committer | Martin Westin <martin@eimermusic.com> | 2013-04-25 09:52:04 +0200 |
commit | 9a79c13c45b34c8bf338d341a421badeb4815c94 (patch) | |
tree | b73fe4913691111d2a50ded779ef43640b0d49ae | |
parent | 8aafb3d33d55130ef40946958f629e269d007bfe (diff) | |
download | rails-9a79c13c45b34c8bf338d341a421badeb4815c94.tar.gz rails-9a79c13c45b34c8bf338d341a421badeb4815c94.tar.bz2 rails-9a79c13c45b34c8bf338d341a421badeb4815c94.zip |
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.
-rw-r--r-- | actionpack/CHANGELOG.md | 9 | ||||
-rw-r--r-- | actionpack/lib/action_view/digestor.rb | 2 | ||||
-rw-r--r-- | actionpack/test/template/digestor_test.rb | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index a545b067b3..6b6515cfb5 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -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. diff --git a/actionpack/lib/action_view/digestor.rb b/actionpack/lib/action_view/digestor.rb index 9324a1ac50..6b9415e55d 100644 --- a/actionpack/lib/action_view/digestor.rb +++ b/actionpack/lib/action_view/digestor.rb @@ -57,7 +57,7 @@ module ActionView end def template - @template ||= finder.find(logical_name, [], partial?, formats: [ format ]) + @template ||= finder.find(logical_name, [], partial?, [], formats: [ format ]) end def source diff --git a/actionpack/test/template/digestor_test.rb b/actionpack/test/template/digestor_test.rb index e29cecabc0..4c4264c0ba 100644 --- a/actionpack/test/template/digestor_test.rb +++ b/actionpack/test/template/digestor_test.rb @@ -15,7 +15,7 @@ end 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 |