aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/file_update_checker.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/file_update_checker.rb b/activesupport/lib/active_support/file_update_checker.rb
index 8708a502e6..eaa5fc56a7 100644
--- a/activesupport/lib/active_support/file_update_checker.rb
+++ b/activesupport/lib/active_support/file_update_checker.rb
@@ -112,7 +112,18 @@ module ActiveSupport
# reloading is not triggered.
def max_mtime(paths)
time_now = Time.now
- paths.map {|path| File.mtime(path)}.reject {|mtime| time_now < mtime}.max
+ time_at_zero = Time.at(0)
+ max_time = time_at_zero
+
+ paths.each do |path|
+ time = File.mtime(path)
+
+ if time < time_now && time > max_time
+ max_time = time
+ end
+ end
+
+ max_time.object_id == time_at_zero.object_id ? nil : max_time
end
def compile_glob(hash)