diff options
author | Drew Ulmer <drew.ulmer@gmail.com> | 2013-06-04 14:39:50 -0500 |
---|---|---|
committer | Drew Ulmer <drew.ulmer@gmail.com> | 2013-06-04 14:39:50 -0500 |
commit | 2a576dd257647871660c3e86f0c4fcddbb5b7105 (patch) | |
tree | feb66ba90076e58dda35f4a1d4987169f5c1952c /actionpack/lib | |
parent | 4b2cb4ac9df5b0c7b98d5d450277b47b8accba9e (diff) | |
download | rails-2a576dd257647871660c3e86f0c4fcddbb5b7105.tar.gz rails-2a576dd257647871660c3e86f0c4fcddbb5b7105.tar.bz2 rails-2a576dd257647871660c3e86f0c4fcddbb5b7105.zip |
Fix mismatching variable names when using an underscore
The ERBTracker template digest helper class was using a regex to match
render calls and it was incorrectly not matching against variables with
underscores in the name. This caused it to use the wrong regex match data
to populate the template dependency. Because underscore is a valid
character for a variable, this fixes the ERBTracker to match it properly.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/dependency_tracker.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/dependency_tracker.rb b/actionpack/lib/action_view/dependency_tracker.rb index 45d17be605..b2e8334077 100644 --- a/actionpack/lib/action_view/dependency_tracker.rb +++ b/actionpack/lib/action_view/dependency_tracker.rb @@ -74,7 +74,7 @@ module ActionView # render(@topic) => render("topics/topic") # render(topics) => render("topics/topic") # render(message.topics) => render("topics/topic") - collect { |name| name.sub(/\A@?([a-z]+\.)*([a-z_]+)\z/) { "#{$2.pluralize}/#{$2.singularize}" } }. + collect { |name| name.sub(/\A@?([a-z_]+\.)*([a-z_]+)\z/) { "#{$2.pluralize}/#{$2.singularize}" } }. # render("headline") => render("message/headline") collect { |name| name.include?("/") ? name : "#{directory}/#{name}" }. |