activeadmin-axlsx icon indicating copy to clipboard operation
activeadmin-axlsx copied to clipboard

Active Admin scoped_collection

Open mmc1ntyre opened this issue 12 years ago • 2 comments
trafficstars

When using a "scoped_collection" to limit the columns returned in an activerecord query you will get the error "ActiveModel::MissingAttributeError".

mmc1ntyre avatar Sep 12 '13 14:09 mmc1ntyre

It appears that if you configure xlsx_builder to delete columns not present this error goes away.

mmc1ntyre avatar Sep 12 '13 14:09 mmc1ntyre

@mmc1ntyre

The gem will pre-fetch all columns on the resource prior to generation so you can edit them in the builder dsl. For this specific case, I've altered serialization to ensure that those attributes actually exist on the resource being passed in.

Can I ask you to have a go at what is currently on master and let me know if this solves the problem without requiring you to manually delete the columns that are not in scope?

randym avatar Oct 12 '13 07:10 randym