aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/comment.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-01-26 06:23:03 +0000
committerMichael Koziarski <michael@koziarski.com>2008-01-26 06:23:03 +0000
commitc48f744400844e4c73eb91c83d86c3e915a9d78b (patch)
tree4ab9aab31349aebaeff17181d1170fdbcc486ebe /activerecord/test/models/comment.rb
parent02625c9c962a868ee7d1a0903d5aaead290ec0ef (diff)
downloadrails-c48f744400844e4c73eb91c83d86c3e915a9d78b.tar.gz
rails-c48f744400844e4c73eb91c83d86c3e915a9d78b.tar.bz2
rails-c48f744400844e4c73eb91c83d86c3e915a9d78b.zip
Make sure that belongs_to counter decrements when assigning nil Closes #10804 [jeanmartin]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/models/comment.rb')
-rw-r--r--activerecord/test/models/comment.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/models/comment.rb b/activerecord/test/models/comment.rb
index 60ca082c2e..73ebdadf73 100644
--- a/activerecord/test/models/comment.rb
+++ b/activerecord/test/models/comment.rb
@@ -1,5 +1,5 @@
class Comment < ActiveRecord::Base
- belongs_to :post
+ belongs_to :post, :counter_cache => true
def self.what_are_you
'a comment...'
@@ -20,4 +20,4 @@ class VerySpecialComment < Comment
def self.what_are_you
'a very special comment...'
end
-end \ No newline at end of file
+end