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"