Skip to content
Browse files

Merge pull request #10377 from bricker/template_digest_ending_with_nu…

…mber

Allow numbers in partial name for digesting
Conflicts:
	actionpack/CHANGELOG.md
  • Loading branch information...
1 parent edc7aaa commit 9470b3cc532ecf5348168a4bebc9366e4d81a08c @rafaelfranca rafaelfranca committed May 6, 2013
View
4 actionpack/CHANGELOG.md
@@ -1,6 +1,8 @@
## unreleased ##
-* No changes.
+* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
+
+ *Bryan Ricker*
## Rails 4.0.0.rc1 (April 29, 2013) ##
View
2 actionpack/lib/action_view/dependency_tracker.rb
@@ -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)
View
3 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
-%>
+%>
View
6 actionpack/test/template/digestor_test.rb
@@ -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 9470b3c

Please sign in to comment.
Something went wrong with that request. Please try again.