modify delete project and user and define a course is a public

This commit is contained in:
xianbo 2013-10-09 21:59:01 +08:00
parent 72f2793b0a
commit 3b6f0e3d34
2 changed files with 2 additions and 5 deletions

View File

@ -780,7 +780,7 @@ class ProjectsController < ApplicationController
project_status = ProjectStatus.find_by_project_id(@project.id) project_status = ProjectStatus.find_by_project_id(@project.id)
project_status.destroy project_status.destroy
elsif params[:project][:is_public] == '1' elsif params[:project][:is_public] == '1'
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0) project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :project_type => 1)
end end
respond_to do |format| respond_to do |format|

View File

@ -84,12 +84,9 @@ class User < Principal
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1" has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
has_many :journal_replies, :dependent => :destroy has_many :journal_replies, :dependent => :destroy
has_many :activities, :dependent => :destroy has_many :activities, :dependent => :destroy
has_many :students_for_courses, :dependent => :destroy has_many :students_for_courses
has_many :courses, :through => :students_for_courses, :source => :project has_many :courses, :through => :students_for_courses, :source => :project
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
##### #####
######added by nie ######added by nie