From fbf7c5c70804ed7617cd794fc7b1f29b66cc4f2e Mon Sep 17 00:00:00 2001 From: Jonne Hass Date: Mon, 12 Sep 2011 16:29:10 +0200 Subject: [PATCH] apply patch from and fix #1954 --- db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb b/db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb index 3e6443fa9..65f6fef00 100644 --- a/db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb +++ b/db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb @@ -4,7 +4,7 @@ class CounterCacheOnPostComments < ActiveRecord::Migration add_column :posts, :comments_count, :integer, :default => 0 execute < 0 UPDATE posts - SET posts.comments_count = (SELECT COUNT(*) FROM comments WHERE comments.post_id = posts.id) + SET comments_count = (SELECT COUNT(*) FROM comments WHERE comments.post_id = posts.id) SQL end