aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-12-16 11:56:51 -0600
committerJoshua Peek <josh@joshpeek.com>2009-12-16 11:56:51 -0600
commit7ee5843c3cedfe36a680d5b28aa31eef45296c50 (patch)
treed399cb71b2533ec353ebbb5cc19a0c0902da1987 /activerecord/lib/active_record.rb
parent1ab35020c152575c84d4ca95842d55be307e1fee (diff)
downloadrails-7ee5843c3cedfe36a680d5b28aa31eef45296c50.tar.gz
rails-7ee5843c3cedfe36a680d5b28aa31eef45296c50.tar.bz2
rails-7ee5843c3cedfe36a680d5b28aa31eef45296c50.zip
Fully expand relative rails framework paths and make sure we aren't
adding any to the load path more than once.
Diffstat (limited to 'activerecord/lib/active_record.rb')
-rw-r--r--activerecord/lib/active_record.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb
index f935d15526..2376bbd04a 100644
--- a/activerecord/lib/active_record.rb
+++ b/activerecord/lib/active_record.rb
@@ -21,11 +21,12 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
-$:.unshift(activesupport_path) if File.directory?(activesupport_path)
-activemodel_path = "#{File.dirname(__FILE__)}/../../activemodel/lib"
-$:.unshift(activemodel_path) if File.directory?(activemodel_path)
+activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
+$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
+
+activemodel_path = File.expand_path('../../../activemodel/lib', __FILE__)
+$:.unshift(activemodel_path) if File.directory?(activemodel_path) && !$:.include?(activemodel_path)
require 'active_support'
require 'active_model'
@@ -91,7 +92,7 @@ module ActiveRecord
module Type
extend ActiveSupport::Autoload
-
+
autoload :Number, 'active_record/types/number'
autoload :Object, 'active_record/types/object'
autoload :Serialize, 'active_record/types/serialize'
@@ -101,14 +102,14 @@ module ActiveRecord
module Locking
extend ActiveSupport::Autoload
-
+
autoload :Optimistic
autoload :Pessimistic
end
module ConnectionAdapters
extend ActiveSupport::Autoload
-
+
autoload :AbstractAdapter
end
end