From 365b8b6db750151b786b0a7ef9e65a6824576f1b Mon Sep 17 00:00:00 2001 From: kennyj Date: Fri, 30 Mar 2012 03:51:08 +0900 Subject: Fix #5563. Should reflect the most recent change to either of association / id. --- activerecord/lib/active_record/associations/association.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 4e09a43f8e..e75003f261 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -132,7 +132,8 @@ module ActiveRecord # ActiveRecord::RecordNotFound is rescued within the method, and it is # not reraised. The proxy is \reset and +nil+ is the return value. def load_target - @target ||= find_target if find_target? + @target = find_target if (@stale_state && stale_target?) || find_target? + loaded! unless loaded? target rescue ActiveRecord::RecordNotFound -- cgit v1.2.3