From 6180943f72469721b96864f5fddc5efcbdf5b6ec Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 11 Sep 2014 17:26:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E6=95=B0=E6=8D=AE=E5=BA=93=E6=97=B6?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=8E=9Fredmine=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8C=89=E5=AD=97=E6=AF=8D=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=EF=BC=8C=E7=8E=B0=E5=9C=A8=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=8C=89=E5=AD=97=E6=AF=8D=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=EF=BC=8C=E6=95=85=E5=B0=86=E4=B9=8B=E6=B3=A8=E9=87=8A=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 4 ++-- app/models/project.rb | 3 ++- db/schema.rb | 16 +++++++++------- 3 files changed, 13 insertions(+), 10 deletions(-) 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|