Suppose you have two parent-child models.

Parent: Parent

Child: Child

When linked with belongs_to, the check of the primary key and foreign key runs, but
Since the primary key is id, I want to check only the foreign key.

・ What I tried
Assuming the foreign key is test_key, I tried the following but couldn't.

class Child
class Parent
  • Answer # 1

    This question was successfully resolved.
    Thank you to everyone who answered.