Topic: counter_cache help
I've added a counter cache to my models, and it seems to be working correctly, except for the fact that the counter is not being updated to the db
Here are the two relevant models:
class FinishedLineItem < ActiveRecord::Base
belongs_to :order, :class_name => "Order", :foreign_key => "order_id", :counter_cache => true
belongs_to :finished_item, :class_name => "FinishedItem", :foreign_key => "finished_item_id"
class Order < ActiveRecord::Base
has_many :finished_line_items, :class_name => "FinishedLineItem"
My orders table has a column called finished_line_items_count which defaults to zero, but it never updates
I am not sure how the count is correctly maintained if the column never updates the count! Can any help explain how this works?