From 6e56a03f834202af4e57c50a71cc74ea08303bfd Mon Sep 17 00:00:00 2001 From: lulalala Date: Tue, 2 Oct 2012 22:30:06 +0800 Subject: Fix reset_counters() crashing on has_many :through associations. The counter column name in the intermediate model need to be access via the through reflection. --- activerecord/test/models/subscription.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/subscription.rb b/activerecord/test/models/subscription.rb index 4bdb36ea46..bcac4738a3 100644 --- a/activerecord/test/models/subscription.rb +++ b/activerecord/test/models/subscription.rb @@ -1,4 +1,4 @@ class Subscription < ActiveRecord::Base - belongs_to :subscriber + belongs_to :subscriber, :counter_cache => :books_count belongs_to :book end -- cgit v1.2.3