diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 943718392..c1593e320 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -468,8 +468,8 @@ class ProjectsController < ApplicationController def new @issue_custom_fields = IssueCustomField.sorted.all - @trackers = Tracker.sorted.all - @project = Project.new + @trackers = Tracker.sorted.all + @project = Project.new @project.safe_attributes = params[:project] render :layout => 'base' end diff --git a/app/models/project.rb b/app/models/project.rb index 1a2c0504d..dfb6ccd2d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -123,7 +123,8 @@ class Project < ActiveRecord::Base # reserved words validates_exclusion_of :identifier, :in => %w( new ) - after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?} + #此代码功能:为原redmine中项目的树形结构按名称首字母排序,本系统项目非树形结构,且项目排序方式无按首字母排序,另该代码执行会使空数据库时创建项目时出异常故注释掉 + #after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?} after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?} # 创建project之后默认创建一个board,之后的board去掉了board的概念 after_create :create_board_sync diff --git a/db/schema.rb b/db/schema.rb index 155b54bfb..95c52cca3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -437,14 +437,14 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.string "web_title" t.string "title" t.text "description" + t.string "page_type" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "page_type" t.integer "sort_type" - t.integer "show_course", :default => 1 - t.integer "show_contest", :default => 1 t.integer "image_width", :default => 107 t.integer "image_height", :default => 63 + t.integer "show_course", :default => 1 + t.integer "show_contest", :default => 1 end create_table "forums", :force => true do |t| @@ -976,11 +976,10 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "project_id" t.integer "user_id" - t.string "description" end create_table "softapplications", :force => true do |t| @@ -1086,8 +1085,8 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "technical_title" t.integer "identity" + t.string "technical_title" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1145,6 +1144,9 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "level" + t.integer "file" + t.integer "issue" end create_table "user_statuses", :force => true do |t|