diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-18 18:49:34 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-18 18:49:34 +0000 |
commit | 49d0f0cb66bc7b6d9cf69bd07b168669b3818cee (patch) | |
tree | 71b84270335a7dbcd7af6b0119654400fee9928c /activerecord/lib/active_record/reflection.rb | |
parent | 3b9bf64130df2512d058d841341d9a082493141e (diff) | |
download | rails-49d0f0cb66bc7b6d9cf69bd07b168669b3818cee.tar.gz rails-49d0f0cb66bc7b6d9cf69bd07b168669b3818cee.tar.bz2 rails-49d0f0cb66bc7b6d9cf69bd07b168669b3818cee.zip |
Speeded up eager loading a whole bunch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1212 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 55a446ff57..6b718704d2 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -114,7 +114,11 @@ module ActiveRecord # Holds all the meta-data about an association as it was specified in the Active Record class. class AssociationReflection < MacroReflection #:nodoc: def klass - active_record.send(:compute_type, (name_to_class_name(name.id2name))) + @klass ||= active_record.send(:compute_type, (name_to_class_name(name.id2name))) + end + + def table_name + @table_name ||= klass.table_name end private |