Skip to content

Consider implement #preload in Draper::CollectionDecorator #812

@teohm

Description

@teohm

We're using datagrid gem together with draper decorators.

They works very well so far, until recently datagrid introduces preload feature, where it actively preloads associations when rendering a ActiveRecord resource.

To fix this breaking change, we have to implement #preload in our Draper::CollectionDecorator subclasses:

class MyCollectionDecorator < Draper::CollectionDecorator
  def preload(*args)
    object.preload(*args).decorate
  end
end

I wonder if it makes sense to move this #preload implementation into Draper::CollectionDecorator?

What do you all think?

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions