diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-07-14 17:40:03 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-14 17:40:58 -0500 |
commit | 9dc258d6147c8dab772d1f041098a38389cd3e73 (patch) | |
tree | 01f14b0fbc7c74b0a87bfbcb0bb9a20835ecac9e /actionpack/lib/action_view/template.rb | |
parent | 76df9fa0680d62ce41fa6f3b743c605101d101d2 (diff) | |
download | rails-9dc258d6147c8dab772d1f041098a38389cd3e73.tar.gz rails-9dc258d6147c8dab772d1f041098a38389cd3e73.tar.bz2 rails-9dc258d6147c8dab772d1f041098a38389cd3e73.zip |
Eager load Partial variable_name and counter_name. Tidy up render_partial_collection.
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r-- | actionpack/lib/action_view/template.rb | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index 03f9234289..42659efbd4 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -17,19 +17,13 @@ module ActionView #:nodoc: end def freeze - # Eager load memoized methods - format_and_extension - path - path_without_extension - path_without_format_and_extension - source - method_segment - - # Eager load memoized methods from Renderable - handler - compiled_source - - instance_variables.each { |ivar| ivar.freeze } + # Eager load and freeze memoized methods + format_and_extension.freeze + path.freeze + path_without_extension.freeze + path_without_format_and_extension.freeze + source.freeze + method_segment.freeze super end @@ -51,12 +45,12 @@ module ActionView #:nodoc: end def source - @source ||= File.read(@filename) + @source ||= File.read(filename) end def method_segment unless @method_segment - segment = File.expand_path(@filename) + segment = File.expand_path(filename) segment.sub!(/^#{Regexp.escape(File.expand_path(RAILS_ROOT))}/, '') if defined?(RAILS_ROOT) segment.gsub!(/([^a-zA-Z0-9_])/) { $1.ord } @method_segment = segment |