对不起,我不能更好地提出这个问题。我希望能够创建一个站并将其保存到数据库中,而无需了解该路由。我如何更改模型?
class Station
include DataMapper::Resource
property :id, String, :key => true
has n, :routes, :through => Resource
end
class Route
include DataMapper::Resource
property :id, Serial, :key => true
has n, :stations, :through => Resource
end
我正在使用rubinius
,data_mapper 1.2
和mariadb
。