Fixed changing templates in development mode [Stephan Kaes]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1891 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-07-22 15:51:34 +00:00
parent 3835f6ab25
commit c19ca5148f
1 changed files with 3 additions and 2 deletions

View File

@ -266,8 +266,9 @@ module ActionView #:nodoc:
def read_template_file(template_path, extension)
info = @@loaded_templates[template_path]
read_file = info.nil?
read_file ||= info.is_a?(Time) && info<File.stat(template_path).mtime unless @@cache_template_loading
read_file = info.nil? || ( info.is_a?(Time) ?
info < File.stat(template_path).mtime :
!@@cache_template_loading )
if read_file
@@loaded_templates[template_path] = info = File.read(template_path)
@@compiled_erb_templates[template_path] = nil if 'rhtml' == extension