增加组织表和组织课程表的关联删除
This commit is contained in:
parent
9baeb850a3
commit
cf41b13f3a
|
@ -18,7 +18,7 @@ class Course < ActiveRecord::Base
|
|||
:conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE})"
|
||||
has_many :principals, :through => :member_principals, :source => :principal
|
||||
has_many :users, :through => :members
|
||||
has_many :org_courses
|
||||
has_many :org_courses, :dependent => :destroy
|
||||
has_many :organizations, :through => :org_courses
|
||||
# has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
|
|
|
@ -5,7 +5,7 @@ class Organization < ActiveRecord::Base
|
|||
has_many :projects,:through => :org_projects
|
||||
has_many :courses, :through => :org_courses
|
||||
has_many :org_document_comments, :dependent => :destroy
|
||||
has_many :org_courses
|
||||
has_many :org_courses, :dependent => :destroy
|
||||
has_many :users, :through => :org_members
|
||||
validates_uniqueness_of :name
|
||||
after_create :save_as_org_activity
|
||||
|
|
Loading…
Reference in New Issue