aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-22 16:10:49 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-22 16:10:49 -0700
commitab321268f86d9013cbd4ecd0b5f46e7b05ec55a9 (patch)
tree94080b82630ad3312e9f29b8ce687f1d6272af34 /activemodel/lib/active_model
parent42a06d2d6253eed3b9f4fb4edfa251c9508a2e20 (diff)
downloadrails-ab321268f86d9013cbd4ecd0b5f46e7b05ec55a9.tar.gz
rails-ab321268f86d9013cbd4ecd0b5f46e7b05ec55a9.tar.bz2
rails-ab321268f86d9013cbd4ecd0b5f46e7b05ec55a9.zip
No more free lunch
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/core.rb15
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'