From 834e5336a5d8a8250251e756385e39ebfb4917c3 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 17 Dec 2010 20:54:50 +0000 Subject: has_many associations with :dependent => :delete_all should update the counter cache when deleting records --- activerecord/test/models/post.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/models/post.rb') diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index 34ea49f731..0083560ebe 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -59,6 +59,8 @@ class Post < ActiveRecord::Base end end + has_many :taggings_with_delete_all, :class_name => 'Tagging', :as => :taggable, :dependent => :delete_all + has_many :misc_tags, :through => :taggings, :source => :tag, :conditions => "tags.name = 'Misc'" has_many :funky_tags, :through => :taggings, :source => :tag has_many :super_tags, :through => :taggings -- cgit v1.2.3