My classes are as follows, with Customer inheriting from User using the single-table inheritance approach. User has attributes name and email while Order has destination.
It seems you have no inverse associations and Rails fails to resolve the order's customer when updating the cached counters. Try this:
class Customer < User has_many :orders, inverse_of: :customer end class Order < ActiveRecord::Base belongs_to :customer, inverse_of: :orders end