Thanks you!
2012/9/24 Zhi-Qiang Lei :
> En taro Tassadar,
>
> You can write it in this way.
>
> class ContactFund
> include DataMapper::Resource
>
> def self.default_repository_name
> :vm_legacy
> end
>
> storage_names[:vm_legacy] = 'contactfunds'
>
> belongs_to :fund
> belongs_to
En taro Tassadar,
You can write it in this way.
class ContactFund
include DataMapper::Resource
def self.default_repository_name
:vm_legacy
end
storage_names[:vm_legacy] = 'contactfunds'
belongs_to :fund
belongs_to :contact
property :fund_id, String, key: true, field: "fundID
En taro Tassadar,
I use DM to access legacy db with many-to-many relationship between Fund
and Contact models, through ContactFund -- table with 2 columns: 'fundID'
and 'contactID'.
Here is my model: http://pastebin.com/KtQcdRyq
But child_key is ignored for some reason, so DM looks for 'fund_id