aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-28 16:27:08 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-28 16:27:08 +0000
commit8a9b998b7960ba171d77cc11bb4f4c318a05ac46 (patch)
tree74a7aee97176bbf4947351d0fbce988032ba629c /activerecord
parent4cd9c9561adcbb8f3267003bd3b01931e457ed6a (diff)
downloadrails-8a9b998b7960ba171d77cc11bb4f4c318a05ac46.tar.gz
rails-8a9b998b7960ba171d77cc11bb4f4c318a05ac46.tar.bz2
rails-8a9b998b7960ba171d77cc11bb4f4c318a05ac46.zip
Fixed that the const_missing autoload assumes the requested constant is set by require_association and calls const_get to retrieve it. If require_association did not set the constant then const_get will call const_missing, resulting in an infinite loop #380 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG12
-rwxr-xr-xactiverecord/lib/active_record/associations.rb2
2 files changed, 12 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index c91e5a4051..1d24ee5933 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,4 +1,14 @@
-*1.3.0*
+*SVN*
+
+* Added the possibility for adapters to overwrite add_limit! to implement a different limiting scheme than "LIMIT X" used by MySQL, PostgreSQL, and SQLite.
+
+* Fixed that the const_missing autoload assumes the requested constant is set by require_association and calls const_get to retrieve it.
+ If require_association did not set the constant then const_get will call const_missing, resulting in an infinite loop #380 [bitsweat]
+
+* Added the possibility of having objects with acts_as_list created before their scope is available or...
+
+
+*1.3.0* (December 23, 2004)
* Added a require_association hook on const_missing that makes it possible to use any model class without requiring it first. This makes STI look like:
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 0336b5d1d3..ccad4120d9 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -18,7 +18,7 @@ class Object
def const_missing(class_id)
begin
require_association(Inflector.underscore(Inflector.demodulize(class_id.to_s)))
- return Object.const_get(class_id) if Object.const_get(class_id).ancestors.include?(ActiveRecord::Base)
+ return Object.const_get(class_id) if Object.const_defined?(class_id) && Object.const_get(class_id).ancestors.include?(ActiveRecord::Base)
rescue LoadError
pre_association_const_missing(class_id)
end