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

competition
sw 11 years ago
parent 7b32debb92
commit 2c689b6399

@ -6,7 +6,7 @@ class Contest < ActiveRecord::Base
has_many :contesting_projects, :dependent => :destroy
has_many :projects, :through => :contesting_projects
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 :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy

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

Loading…
Cancel
Save