jcasimir/draper — Issue #54: Using Draper with InheritedResources or ActiveAdmin
Author: jcarlson
Created: 2011-10-19 02:38:12+00:00
State: open

I would love to use Draper with a back-end helper like ActiveAdmin... the trouble is that InheritedResources and ActiveAdmin depend a lot on scopes, and thus the ActiveRecord::Relation class.

For example:

```ruby
>> posts = Post.published # a scope on the Post model
=> [...some Post instances]
>> posts.class
=> ActiveRecord::Relation
>> posts = PostDecorator.decorate(posts)
=> [...some PostDecorator instances]
>> posts.class
=> Array
```

After decorating the scoped array of Posts, we lose access to the chainable methods that ActiveAdmin is looking for...

Any thoughts?