在Sequel / Ruby中映射嵌套模型对象?

时间:2019-05-10 06:38:46

标签: sequel

我的数据库中有一个“订单”表,其中包含订单运送地址的列,例如shipping_address_streetshipping_address_city(旧版,因此无法更改)。我想将这些字段映射到包含地址的所有属性的嵌套Address对象。

Property order_number maps to column order_number
Property shipping_address contains an object of class `Address`
    Property shipping_address.street maps to column shipping_address_street
    Property shipping_address.city maps to column shipping_address_city

续集支持吗?

1 个答案:

答案 0 :(得分:-1)