From a74e5f9d308b6ff1a82d2e7cefbe218dd9146523 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 12 Jan 2016 15:18:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=95=B0=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20160111080914_static_project_acts.rb | 6 +++--- db/schema.rb | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/db/migrate/20160111080914_static_project_acts.rb b/db/migrate/20160111080914_static_project_acts.rb index c368507a3..3f07cbb03 100644 --- a/db/migrate/20160111080914_static_project_acts.rb +++ b/db/migrate/20160111080914_static_project_acts.rb @@ -3,10 +3,10 @@ class StaticProjectActs < ActiveRecord::Migration Project.all.each do |project| acts = ForgeActivity.where("project_id = ?", project.id) unless acts.blank? - acts_count = acts.count + count = acts.count puts project.id - puts "acts_count is #{acts_count}" - project.update_attribute(:acts_count, acts_count) + puts "acts_count is #{count}" + project.update_attribute(:acts_count, count) end end end diff --git a/db/schema.rb b/db/schema.rb index c8d649ccd..6197c2c76 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160111065530) do +ActiveRecord::Schema.define(:version => 20160111080914) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1415,6 +1415,7 @@ ActiveRecord::Schema.define(:version => 20160111065530) do t.integer "attachments_count", :default => 0 t.integer "boards_count", :default => 0 t.integer "news_count", :default => 0 + t.integer "acts_count", :default => 0 end add_index "projects", ["lft"], :name => "index_projects_on_lft"