aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependencies.rb
diff options
context:
space:
mode:
authorJonathan del Strother <jon.delStrother@audioboo.fm>2011-08-24 17:30:50 +0100
committerJonathan del Strother <jon.delStrother@audioboo.fm>2011-08-24 18:14:25 +0100
commite0714ee005a366aa92449fc4f92cf97aa8e2f349 (patch)
treeaa4df7b0395e95602561faff609a1a80d127704d /activesupport/lib/active_support/dependencies.rb
parent976b2be1085aa22f84c6fcbe40ba25ba4f89051c (diff)
downloadrails-e0714ee005a366aa92449fc4f92cf97aa8e2f349.tar.gz
rails-e0714ee005a366aa92449fc4f92cf97aa8e2f349.tar.bz2
rails-e0714ee005a366aa92449fc4f92cf97aa8e2f349.zip
Fix autoload_once_paths when using Pathnames & ruby 1.9
Under ruby 1.9.2 - "/var/log".starts_with?(Pathname.new("/var")) # => false so setting config.autoload_once_paths with Pathnames would not work
Diffstat (limited to 'activesupport/lib/active_support/dependencies.rb')
-rw-r--r--activesupport/lib/active_support/dependencies.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index 6252e7f7c3..c072a8e646 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -421,7 +421,8 @@ module ActiveSupport #:nodoc:
end
def load_once_path?(path)
- autoload_once_paths.any? { |base| path.starts_with? base }
+ # to_s works around a ruby1.9 issue where #starts_with?(Pathname) will always return false
+ autoload_once_paths.any? { |base| path.starts_with? base.to_s }
end
# Attempt to autoload the provided module name by searching for a directory