diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-26 06:56:17 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-26 06:56:17 +0000 |
commit | 1caa76304b6eef3d637d861585bda72ed367567f (patch) | |
tree | 59e6c69bc870012a6104670dd92abc0d2145425b /activerecord/lib/active_record | |
parent | e5a0a2732718bebf17e43bf817864561daeada3f (diff) | |
download | rails-1caa76304b6eef3d637d861585bda72ed367567f.tar.gz rails-1caa76304b6eef3d637d861585bda72ed367567f.tar.bz2 rails-1caa76304b6eef3d637d861585bda72ed367567f.zip |
has_one associations with a nil target may be safely marshaled. Closes #6279.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/association_proxy.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index ac7188d712..4cdbc52ccf 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -125,6 +125,8 @@ module ActiveRecord end def load_target + return nil unless defined?(@loaded) + if !loaded? and (!@owner.new_record? || foreign_key_present) @target = find_target end |