aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderable.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-06 01:13:15 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-06 01:13:15 -0500
commit1d8623b42f6249613d39e834a8742b3b143f2aff (patch)
treef8316aab80fd86c15008d218d2a33717ff4b3c74 /actionpack/lib/action_view/renderable.rb
parent7b9e8ae2734089555e5bfdb9e9c80d92f43551a2 (diff)
downloadrails-1d8623b42f6249613d39e834a8742b3b143f2aff.tar.gz
rails-1d8623b42f6249613d39e834a8742b3b143f2aff.tar.bz2
rails-1d8623b42f6249613d39e834a8742b3b143f2aff.zip
Added local assign keys to compiled method name so two threads evaluating the same template with different locals don't step on top of each other
Diffstat (limited to 'actionpack/lib/action_view/renderable.rb')
-rw-r--r--actionpack/lib/action_view/renderable.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb
index 2e2fff44c6..3a30e603fe 100644
--- a/actionpack/lib/action_view/renderable.rb
+++ b/actionpack/lib/action_view/renderable.rb
@@ -12,7 +12,7 @@ module ActionView
end
def method
- ['_run', @extension, @method_segment].compact.join('_').to_sym
+ ['_run', @extension, @method_segment, local_assigns_keys].compact.join('_').to_sym
end
private
@@ -28,5 +28,11 @@ module ActionView
@prepared = true
end
end
+
+ def local_assigns_keys
+ if @locals && @locals.any?
+ "locals_#{@locals.keys.map { |k| k.to_s }.sort.join('_')}"
+ end
+ end
end
end