aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-11-10 02:00:14 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-11-10 02:00:14 +0000
commit63df6eb3821ba9723a3478f6331bd14b81be8140 (patch)
treee3245c8d2ded2289570cf3e8105f8cd6b5a6ee6f /activerecord/lib/active_record
parentd97a84fb593746caa5806704fe3018aa3f3fc422 (diff)
downloadrails-63df6eb3821ba9723a3478f6331bd14b81be8140.tar.gz
rails-63df6eb3821ba9723a3478f6331bd14b81be8140.tar.bz2
rails-63df6eb3821ba9723a3478f6331bd14b81be8140.zip
Don't inspect unloaded associations. Closes #2905.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/association_proxy.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb
index 1b929f28bd..f84a2a89b7 100644
--- a/activerecord/lib/active_record/associations/association_proxy.rb
+++ b/activerecord/lib/active_record/associations/association_proxy.rb
@@ -72,6 +72,10 @@ module ActiveRecord
loaded
end
+ def inspect
+ loaded? ? @target.inspect : "<#{@reflection.name} not loaded yet>"
+ end
+
protected
def dependent?
@reflection.options[:dependent] || false