Rails: Model fails to save cached column .counts
问题 Ok, this has me wildly stumped. I have a model PhoneNumbers which has an integer column sent_messages_count . I use background tasks to use this column as a counter cache, however, this column's inaccuracies appears to be more fundamental. Here's what I'd like to do: phone_number.sent_messages_count = phone_number.sent_messages.count Note that I'm setting the table column to the count of an association. Underscore vs. period. See my console session... (I've done some clean-up to make it more