diff options
-rw-r--r-- | activesupport/lib/active_support/file_evented_update_checker.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/file_evented_update_checker.rb b/activesupport/lib/active_support/file_evented_update_checker.rb index 5e5874c014..638458c6ce 100644 --- a/activesupport/lib/active_support/file_evented_update_checker.rb +++ b/activesupport/lib/active_support/file_evented_update_checker.rb @@ -79,13 +79,8 @@ module ActiveSupport using Module.new { refine Pathname do def ascendant_of?(other) - if self != other && other.to_s.start_with?(to_s) - # On Windows each_filename does not include the drive letter, - # but the test above already detects if they differ. - parts = each_filename.to_a - other_parts = other.each_filename.to_a - - other_parts[0, parts.length] == parts + self != other && other.ascend do |ascendant| + break true if self == ascendant end end end |