Shopify/batman — pull request #629 by tehael (2012-12-30 11:26:56+00:00)
Title: Deeply nested urls

in order to define that url nesting should be deep you have to pass
the parents as an array.
e.g.:
class Product extends Batman.Model
@persist Batman.RestStorage
@urlNestsUnder ['shop', 'manufacturer'], 'order'

if not all of the parent ids are set for the
deeply nested url, this deep nesting is ignored and it falls back to the
other given nestings or no nesting at all
e.g.: (from above)
Product.url shop_id:1, manufacturer_id:
=> shops/1/manufacturers/2/products
Product.url shop_id:1, order_id:
=> orders/2/products
Product.url shop_id:1
=> products

It is especially useful, when your backend database is document based, like mongodb, and you can only access (deeply) embedded documents through the parent documents and your backend urls more or less must replicate that nesting/embedding.