几个月前我接管了一个涉及无限深度的多态关联的项目..我想了解如何在模型上进行操作。在rails中更新多态关联
这是模特如何看起来像一个示例:https://gist.github.com/1701475
CallFlow
- RouteByXxxx
---- XxxxOption
实际上有6个协会CallFlow(RouteByXxxx)它们都具有子(ren)XxxxOption是一个选项列表。
schema.rb:https://gist.github.com/1701475
我最大的问题:我将如何去有关更新中的IvrOption记录一个target_did时,我只有一个CallFlow相关DNIS?
实际上,关联看起来像这样:
CallFlow(routable_type = RouteByMessage)
-RouteByMessage
--MessageOption(target_routable_type = RouteByIvr)
--- RouteByIvr
---- IvrOption( target_routable_type = null,target_did = 1112223333)