diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-07-05 17:49:49 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-05 17:49:49 -0500 |
commit | f22ae15a8e30f7ad475acdbcfcd1120e498cfede (patch) | |
tree | 132fc0405f9e846abdb2a975a554524ac8cf1f62 /actionpack | |
parent | 5a3bc6f12f7ca78d7ce569f6541d691e42fac6f8 (diff) | |
download | rails-f22ae15a8e30f7ad475acdbcfcd1120e498cfede.tar.gz rails-f22ae15a8e30f7ad475acdbcfcd1120e498cfede.tar.bz2 rails-f22ae15a8e30f7ad475acdbcfcd1120e498cfede.zip |
Use the inline template's hash as a method key instead of relying on a counter
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/inline_template.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/inline_template.rb b/actionpack/lib/action_view/inline_template.rb index fb5e4408db..965df96e3b 100644 --- a/actionpack/lib/action_view/inline_template.rb +++ b/actionpack/lib/action_view/inline_template.rb @@ -2,10 +2,6 @@ module ActionView #:nodoc: class InlineTemplate #:nodoc: include Renderable - # Count the number of inline templates - cattr_accessor :inline_template_count - @@inline_template_count = 0 - def initialize(view, source, locals = {}, type = nil) @view = view @@ -13,14 +9,13 @@ module ActionView #:nodoc: @extension = type @locals = locals || {} - @method_key = @source + @method_key = "inline_#{@source.hash.abs}" @handler = Template.handler_class_for_extension(@extension).new(@view) end private - # FIXME: Modifying this shared variable may not thread safe def method_name_path_segment - "inline_#{@@inline_template_count += 1}" + @method_key end end end |