In [88]: c
Out[88]:
Address Name
CustomerID
10 Address for Mike Mike
11 Address for Marcia Marcia
In [89]: c.index
Out[89]: Int64Index([10, 11], dtype='int64', name='Custom
我有两个模型通过belongs_to和has_many关系链接在一起,如下所示。 Class OtherModel < ActiveRecord::Base
belongs_to my_model
end
class MyModel < ActiveRecord::Base
has_many other_models
end
我现在有相应的测试来验证它们具有如下所示