Class: MR::FakeRecord::BelongsToAssociation
- Inherits:
-
OneToOneAssociation
- Object
- Association
- OneToOneAssociation
- MR::FakeRecord::BelongsToAssociation
- Defined in:
- lib/mr/fake_record/associations.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Association
Instance Method Summary collapse
Methods inherited from OneToOneAssociation
Methods inherited from Association
#<=>, #initialize, #klass, #read, #write
Constructor Details
This class inherits a constructor from MR::FakeRecord::Association
Instance Method Details
#write_attributes(associated_fake_record) ⇒ Object
234 235 236 237 238 |
# File 'lib/mr/fake_record/associations.rb', line 234 def write_attributes(associated_fake_record) super associated_id = associated_fake_record.id @owner.send("#{self.reflection.foreign_key}=", associated_id) end |