From 0238001721193233a827efbcdd18866b77dacf1c Mon Sep 17 00:00:00 2001 From: xianbo Date: Mon, 14 Oct 2013 20:57:31 +0800 Subject: [PATCH] modify destroy project and user can't destroy biding_project --- app/models/project.rb | 3 +++ app/models/user.rb | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index 5cf53cc8..e85d5007 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -51,6 +51,9 @@ class Project < ActiveRecord::Base has_one :repository, :conditions => ["is_default = ?", true] has_many :repositories, :dependent => :destroy has_many :changesets, :through => :repository + #added by xianbo for delete biding_project + has_many :biding_projects, :dependent => :destroy + #ended by xianbo # added by fq has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :homework_for_courses, :dependent => :destroy diff --git a/app/models/user.rb b/app/models/user.rb index 1bce9805..2d6b5908 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -75,7 +75,9 @@ class User < Principal has_one :rss_token, :class_name => 'Token', :conditions => "action='feeds'" has_one :api_token, :class_name => 'Token', :conditions => "action='api'" belongs_to :auth_source - +## added by xianbo for delete + has_many :biding_projects, :dependent => :destroy +##ended by xianbo #####fq has_many :jours, :class_name => 'JournalsForMessage', :dependent => :destroy