在汽车类中定义了多态界面
belongs_to :car_type(interface name change according to you), polymorphic: true
在汽车制造商课上
has_many :cars, as: :car_type
在Carmodel课程中
has_many :cars, as: :car_type
在地区类中
has_many :cars, as: :car_type
每当您将记录存储在汽车表中。...存储将是(汽车制造商,Carmodel,Region)和ID的对象类型