1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

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