Rails Association checker


How to use

Supported association types: provide "belongs_to", "has_many", "has_many :through". You can choose type below.

Supported options of "belongs_to" and "has_many" are: class_name, foreign_key, primary_key, others might cause error.
Supported options of "has_many :through" are: through, source, others might cause error.

There are two kinds of checking method:
1. Fill out "Model setup", leave "DB schema" empty. After "Check" button clicked, Rails conventions of your setup will show on the result panel.(This funtion is not apply to has_many :through)
2. Fill out all setup. After "Check" button clicked, the program will tell which part is OK or should be modify according to Rails conventions.

PS:
1. Code of singular/plural translation is copy form Stackoverflow. It might not cover all words, you can check it on this page beforehand.
2. Notes about Rails conventions on Medium


Association type


Model setup(belongs_to)

Class < ActiveRecord


end

DB schema

belongs_to

Your foreign key:

Target model name:

Target primary key:

has_many / has_many :through

Your primary key:

Target model name:

Target foreign key:

Result