Permalink
Browse files

Merge pull request #10377 from bricker/template_digest_ending_with_nu…

…mber

Allow numbers in partial name for digesting
  • Loading branch information...
2 parents b8577bb + 3c516c4 commit 925728c283f2d6f8f41bf79f6958494f14560aeb @rafaelfranca rafaelfranca committed May 7, 2013
View
@@ -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.
@@ -39,7 +39,7 @@ class ERBTracker
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)
@@ -7,7 +7,8 @@
<%= render @message.history.events %>
<%# render "something_missing" %>
+<%# render "something_missing_1" %>
<%
# Template Dependency: messages/form
-%>
+%>
@@ -83,6 +83,12 @@ def test_logging_of_missing_template
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")

0 comments on commit 925728c

Please sign in to comment.