aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/file_update_checker.rb
diff options
context:
space:
mode:
authorabonec <abonec@gmail.com>2012-06-29 19:43:33 +0400
committerabonec <abonec@gmail.com>2012-06-29 19:43:33 +0400
commit20519efa6ede07b7a7f43ccd69d39b84c39f8195 (patch)
tree6f60b70e9d1682f54d78744cae444b4a62629139 /activesupport/lib/active_support/file_update_checker.rb
parent0470ddcf0301e537d5151d62177eadba5eae182d (diff)
downloadrails-20519efa6ede07b7a7f43ccd69d39b84c39f8195.tar.gz
rails-20519efa6ede07b7a7f43ccd69d39b84c39f8195.tar.bz2
rails-20519efa6ede07b7a7f43ccd69d39b84c39f8195.zip
fix FileUpdateChecker when file has wrong mtime (from future)
Diffstat (limited to 'activesupport/lib/active_support/file_update_checker.rb')
-rw-r--r--activesupport/lib/active_support/file_update_checker.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/file_update_checker.rb b/activesupport/lib/active_support/file_update_checker.rb
index 48c39d9370..9decbaef32 100644
--- a/activesupport/lib/active_support/file_update_checker.rb
+++ b/activesupport/lib/active_support/file_update_checker.rb
@@ -101,7 +101,9 @@ module ActiveSupport
end
def updated_at(paths)
- @updated_at || paths.map { |path| File.mtime(path) }.max || Time.at(0)
+ time_now = Time.now
+ @updated_at || paths.map { |path| File.mtime(path) }.
+ reject { |time| time > time_now }.max || Time.at(0)
end
def compile_glob(hash)