activeadmin icon indicating copy to clipboard operation
activeadmin copied to clipboard

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

Open plashchynski opened this issue 4 years ago • 0 comments

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 avatar Feb 21 '22 13:02 plashchynski