nesquena/rabl — pull request #246 by OliverLetterer (2012-05-20 09:42:09+00:00)
Title: Adds root_object getter to engine.

We are using single table inheritance in one of our mountable engines. Therefore, we have an abstract model `Dashboard::Workflow` and for example a subclass `Dashboard::PlainWorkflow`. Now we want to dry out our views by rendering

```
# dashboard/workflows/show.json.rabl

object @workflow

extends "dashboard/subclass_name/show.json.rabl"
```

and therefore we need to have access to the object we pass in `object @workflow` to automatically do something like

```
# dashboard/workflows/show.json.rabl

object @workflow

extends "dashboard/#{root_object.class.name.demodulize.pluralize.underscore}/show.json.rabl"
```

I hope haven't overlooked any current implementation that already does this.