删除竞赛时删除竞赛下所有作品
This commit is contained in:
parent
7b32debb92
commit
2c689b6399
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue