From 63df6eb3821ba9723a3478f6331bd14b81be8140 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 10 Nov 2006 02:00:14 +0000 Subject: Don't inspect unloaded associations. Closes #2905. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/associations/association_proxy.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record') 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 -- cgit v1.2.3