Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active Admin scoped_collection #18

Open
mmc1ntyre opened this issue Sep 12, 2013 · 2 comments
Open

Active Admin scoped_collection #18

mmc1ntyre opened this issue Sep 12, 2013 · 2 comments

Comments

@mmc1ntyre
Copy link

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

@mmc1ntyre
Copy link
Author

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

@randym
Copy link
Owner

randym commented Oct 12, 2013

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants