From 0123c39f41e2062311b2197e6e230ef8ad67e20e Mon Sep 17 00:00:00 2001 From: Takehiro Adachi Date: Sat, 18 May 2013 17:12:46 +0900 Subject: Add test to AR's counter_cache_test.rb According to https://github.com/rails/rails/blob/b601399b72ab56cc01368f02615af99f45d1 4f02/activerecord/lib/active_record/counter_cache.rb#L14, u can pass more then one association to the `reset_counters` method. --- activerecord/test/models/reply.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/reply.rb b/activerecord/test/models/reply.rb index c88262580e..3e82e55d89 100644 --- a/activerecord/test/models/reply.rb +++ b/activerecord/test/models/reply.rb @@ -7,6 +7,7 @@ class Reply < Topic end class UniqueReply < Reply + belongs_to :topic, :foreign_key => 'parent_id', :counter_cache => true validates_uniqueness_of :content, :scope => 'parent_id' end -- cgit v1.2.3