aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-06 18:36:37 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-06 18:36:37 -0700
commit925728c283f2d6f8f41bf79f6958494f14560aeb (patch)
tree4701022c8b3382f38629543f05b82eab87eb34cf /actionpack
parentb8577bb67356fead9b72fe36766e32495aa56f52 (diff)
parent3c516c4b5278c27d55425f7c2f875ca1cd2e8511 (diff)
downloadrails-925728c283f2d6f8f41bf79f6958494f14560aeb.tar.gz
rails-925728c283f2d6f8f41bf79f6958494f14560aeb.tar.bz2
rails-925728c283f2d6f8f41bf79f6958494f14560aeb.zip
Merge pull request #10377 from bricker/template_digest_ending_with_number
Allow numbers in partial name for digesting
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG.md4
-rw-r--r--actionpack/lib/action_view/dependency_tracker.rb2
-rw-r--r--actionpack/test/fixtures/digestor/messages/show.html.erb3
-rw-r--r--actionpack/test/template/digestor_test.rb6
4 files changed, 12 insertions, 3 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index ffafa7412d..6f5027dc23 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,3 +1,5 @@
-* No changes.
+* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
+
+ *Bryan Ricker*
Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes.
diff --git a/actionpack/lib/action_view/dependency_tracker.rb b/actionpack/lib/action_view/dependency_tracker.rb
index a2a555dfcb..45d17be605 100644
--- a/actionpack/lib/action_view/dependency_tracker.rb
+++ b/actionpack/lib/action_view/dependency_tracker.rb
@@ -39,7 +39,7 @@ module ActionView
render\s* # render, followed by optional whitespace
\(? # start an optional parenthesis for the render call
(partial:|:partial\s+=>)?\s* # naming the partial, used with collection -- 1st capture
- ([@a-z"'][@a-z_\/\."']+) # the template name itself -- 2nd capture
+ ([@a-z"'][@\w\/\."']+) # the template name itself -- 2nd capture
/x
def self.call(name, template)
diff --git a/actionpack/test/fixtures/digestor/messages/show.html.erb b/actionpack/test/fixtures/digestor/messages/show.html.erb
index 51b3b61e8e..130e67109e 100644
--- a/actionpack/test/fixtures/digestor/messages/show.html.erb
+++ b/actionpack/test/fixtures/digestor/messages/show.html.erb
@@ -7,7 +7,8 @@
<%= render @message.history.events %>
<%# render "something_missing" %>
+<%# render "something_missing_1" %>
<%
# Template Dependency: messages/form
-%> \ No newline at end of file
+%>
diff --git a/actionpack/test/template/digestor_test.rb b/actionpack/test/template/digestor_test.rb
index e29cecabc0..06735c30d3 100644
--- a/actionpack/test/template/digestor_test.rb
+++ b/actionpack/test/template/digestor_test.rb
@@ -83,6 +83,12 @@ class TemplateDigestorTest < ActionView::TestCase
end
end
+ def test_logging_of_missing_template_ending_with_number
+ assert_logged "Couldn't find template for digesting: messages/something_missing_1.html" do
+ digest("messages/show")
+ end
+ end
+
def test_nested_template_directory
assert_digest_difference("messages/show") do
change_template("messages/actions/_move")