The checker makes an assumption that foreign-key like columns should be in the form of ..._id.
It can:
lead to false positives, when some table have some column ending with _id which is not a reference to other table, but, for example, some id from the external resource (users.stripe_id).
miss some custom named foreign keys: belongs_to :user, foreign_key: :user_key
I think, what should be really checked are models having non-polymorphic belongs_to associations without foreign keys.
Checking only models would make it easier to also ignore the case, when underlying models belong to different databases.
The checker makes an assumption that foreign-key like columns should be in the form of
..._id
.It can:
_id
which is not a reference to other table, but, for example, some id from the external resource (users.stripe_id
).belongs_to :user, foreign_key: :user_key
I think, what should be really checked are models having non-polymorphic
belongs_to
associations without foreign keys.Checking only models would make it easier to also ignore the case, when underlying models belong to different databases.