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

A show page does not display a field ends with a "_count" substring #7346

Closed
plashchynski opened this issue Feb 21, 2022 · 1 comment · May be fixed by #7347
Closed

A show page does not display a field ends with a "_count" substring #7346

plashchynski opened this issue Feb 21, 2022 · 1 comment · May be fixed by #7347

Comments

@plashchynski
Copy link

I have a model with some column ends with a "_count" substring. This column doesn't appear on a show page. It should appear as It is a regular column just like any other.

I've figured out that this is because this column filtered out as a counter cache column by the following code in ActiveAdmin::Resource::Attributes#counter_cache_col?

The code simply checks that the column has a name that ends with "_count". On the one hand, this leads to the situation where a regular columns are filtered out. On the other hand, this code will not filter a counter cache column with a custom name that doesn't match "*_count".

plashchynski added a commit to plashchynski/activeadmin that referenced this issue Feb 21, 2022
Check the column is actually a counter cache column. Fixes activeadmin#7346
@javierjulio
Copy link
Member

Thank you for submitting a PR for this. We'll update it and take it from there.

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