Skip to content
Browse files

Use self.target= in HasOneThroughAssociation too

  • Loading branch information...
1 parent b7594a0 commit 8aedd722e119770908eb3956ad91f4c88f425eb5 @jonleighton jonleighton committed with tenderlove Jan 16, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 activerecord/lib/active_record/associations/has_one_through_association.rb
View
7 activerecord/lib/active_record/associations/has_one_through_association.rb
@@ -4,10 +4,9 @@ module Associations
class HasOneThroughAssociation < HasOneAssociation
include ThroughAssociation
- def replace(new_value)
- create_through_record(new_value)
- @target = new_value
- loaded
+ def replace(record)
+ create_through_record(record)
+ self.target = record
end
private

0 comments on commit 8aedd72

Please sign in to comment.
Something went wrong with that request. Please try again.