datamapper / dm-serializer

DataMapper plugin for serializing Resources and Collections
http://datamapper.org/
MIT License
40 stars 44 forks source link

extracting multiple multiple levels #18

Open 1xch opened 13 years ago

1xch commented 13 years ago

Perhaps not an issue, but a question for something I can't get to work

4 models, each associated to the one above List Categories Items Item choices

Given aa is a List

bb = aa.to_json(:relationships=>{:categories=>{:include=>[:name],:methods=>[:items]}}) works

but trying to go deeper to Item choices, I've been getting nothing.

This is the closest I've gotten without error, but doesn't actually pull up itemchoices

aa.to_json(:relationships=>{:categories=>{:include=>[:name],:methods=>[:items], :relationships=>{:multiplechoices=>{:include=>[:itemchoices]}}}})

I'm guessing I need to fuddle around a bit more, and wondering if there is some limit or barrier to getting multiple levels, supposing I need to go even more complex, another six levels as an example