diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index ffafa7412d4530c489107a0692e0ff1b430e0a96..6f5027dc234698f5bb00bedd36a92742c70654c7 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 a2a555dfcb6deb6f1f73bd4c0eca0e5251874c92..45d17be6055325b4d85a8c1f9001760108b6eaf9 100644 --- a/actionpack/lib/action_view/dependency_tracker.rb +++ b/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) diff --git a/actionpack/test/fixtures/digestor/messages/show.html.erb b/actionpack/test/fixtures/digestor/messages/show.html.erb index 51b3b61e8ef9a20deae9e1eebc7fbcbd102e4436..130e67109ebf468d1bc534f6ca348bbabf0fd60f 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 e29cecabc03c5ff71af342d718f404dc0a2a2639..06735c30d380bdd161888f3671af31b503829ad6 100644 --- a/actionpack/test/template/digestor_test.rb +++ b/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")