activeadmin
activeadmin copied to clipboard
A show page does not display a field ends with a "_count" substring
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".