An ActiveRecord extension that helps you count association using SQL. Since the association counting was computed within a single query, it's at least better than doing n+1 queries. The main idea is ...
CALL add_column_if_not_exists('im_genes', 'scope', "VARCHAR(60) NOT NULL DEFAULT 'global'"); CALL add_column_if_not_exists('im_evolution_edges', 'scope', "VARCHAR(60 ...