Open
Description
When saving a resource with a has_one relationship with foreign_key_on: :related
I get an error of undefined method 'foreign_key='
for the model. I'm not sure if the intent is to change the relationship on the related items when save or not. For now I did the following patch to not update any relationships that have foreign_key_on: :related
def replace_to_one_link(relationship_type, relationship_key_value)
if(self.class._relationships[relationship_type.to_sym]).belongs_to?
super
end
end
def replace_polymorphic_to_one_link(relationship_type, relationship_key_value, relationship_key_type)
if(self.class._relationships[relationship_type.to_sym]).belongs_to?
super
end
end