mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Use self.target= in HasOneThroughAssociation too
This commit is contained in:
committed by
Aaron Patterson
parent
b7594a0756
commit
8aedd722e1
@@ -4,10 +4,9 @@ module ActiveRecord
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user