diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-02 08:24:39 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-02 08:24:39 +0000 |
commit | 0ca544d7b38c5f93b940c1709b361ba8d54d1194 (patch) | |
tree | 63ea93d07a7331cbc82a6f08ebc44d8f7e22b1e0 /activesupport | |
parent | f7c61b629e76e21ae78c6da3e9f6ee070d03bae8 (diff) | |
download | rails-0ca544d7b38c5f93b940c1709b361ba8d54d1194.tar.gz rails-0ca544d7b38c5f93b940c1709b361ba8d54d1194.tar.bz2 rails-0ca544d7b38c5f93b940c1709b361ba8d54d1194.zip |
Fixed problem with classes being required twice. Object#const_missing now uses require_dependency to load files. It used to use require_or_load which would cause models to be loaded twice, which was not good for validations and other class methods #971 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1057 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/CHANGELOG | 5 | ||||
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index c6af6c288d..c323bd2ea5 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,3 +1,8 @@ +*SVN* + +* Fixed problem with classes being required twice. Object#const_missing now uses require_dependency to load files. It used to use require_or_load which would cause models to be loaded twice, which was not good for validations and other class methods #971 [Nicholas Seckar] + + *1.0.3* (27th March, 2005) * Fixed Inflector.pluralize to handle capitalized words #932 [bitsweat] diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index a189da189a..91f1f54f5a 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -175,7 +175,7 @@ class Object #:nodoc: end begin - require_or_load(class_id.to_s.demodulize.underscore) + require_dependency(class_id.to_s.demodulize.underscore) if Object.const_defined?(class_id) then return Object.const_get(class_id) else raise LoadError end rescue LoadError => e raise NameError.new("uninitialized constant #{class_id}").copy_blame!(e) |