diff options
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/core.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/core.rb b/activemodel/lib/active_model/core.rb index 47b968e121..6b2bee53d9 100644 --- a/activemodel/lib/active_model/core.rb +++ b/activemodel/lib/active_model/core.rb @@ -1,7 +1,12 @@ -# This file is required by each major ActiveModel component for the core requirements. This allows you to -# load individual pieces of ActiveModel as needed. -$LOAD_PATH << File.join(File.dirname(__FILE__), '..', '..', '..', 'activesupport', 'lib') +begin + require 'active_support' +rescue LoadError + activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib" + if File.directory?(activesupport_path) + $:.unshift activesupport_path + require 'active_support' + end +end -# premature optimization? # So far, we only need the string inflections and not the rest of ActiveSupport. -require 'active_support/inflector'
\ No newline at end of file +require 'active_support/inflector' |