class MR::FakeRecord::PolymorphicBelongsToAssociation
Public Instance Methods
klass()
click to toggle source
# File lib/mr/fake_record/associations.rb, line 248 def klass class_name = @owner.send(self.reflection.foreign_type) class_name.constantize if class_name end
write_attributes(associated_fake_record)
click to toggle source
Calls superclass method
MR::FakeRecord::BelongsToAssociation#write_attributes
# File lib/mr/fake_record/associations.rb, line 242 def write_attributes(associated_fake_record) super associated_type = associated_fake_record.class.name @owner.send("#{self.reflection.foreign_type}=", associated_type) end