删除竞赛时删除竞赛下所有作品

This commit is contained in:
sw 2014-07-31 14:02:25 +08:00
parent 7b32debb92
commit 2c689b6399
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ class Contest < ActiveRecord::Base
has_many :contesting_projects, :dependent => :destroy has_many :contesting_projects, :dependent => :destroy
has_many :projects, :through => :contesting_projects has_many :projects, :through => :contesting_projects
has_many :contesting_softapplications, :dependent => :destroy has_many :contesting_softapplications, :dependent => :destroy
has_many :softapplications, :through => :contesting_softapplications has_many :softapplications, :through => :contesting_softapplications, :dependent => :destroy
has_many :projects_member, :class_name => 'User', :through => :projects has_many :projects_member, :class_name => 'User', :through => :projects
has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy

View File

@ -3,7 +3,7 @@ class ContestingSoftapplication < ActiveRecord::Base
attr_accessible :contest_id, :description, :softapplication_id, :user_id attr_accessible :contest_id, :description, :softapplication_id, :user_id
belongs_to :contest belongs_to :contest
belongs_to :softapplication belongs_to :softapplication, :dependent => :destroy
belongs_to :user belongs_to :user