Policies.joins(:insurances).group("policies.id").count
will give you a hash where the key is the policies.id and the value is the count of the insurances for each policy.
NOTE: if a policy does not have any insurances, it will not be included in the result.