课程所包含的子功能模块(enabled_modules)相关逻辑修改

This commit is contained in:
nwb 2014-06-04 11:32:32 +08:00
parent d87b52bedd
commit c43bf84e42
2 changed files with 3 additions and 2 deletions

View File

@ -22,8 +22,9 @@ class Member < ActiveRecord::Base
has_many :roles, :through => :member_roles
belongs_to :project
belongs_to :course
validates_presence_of :principal, :project
validates_presence_of :principal
validates_uniqueness_of :user_id, :scope => :project_id
validate :validate_role

View File

@ -38,7 +38,7 @@ class Project < ActiveRecord::Base
:conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE})"
has_many :users, :through => :members
has_many :principals, :through => :member_principals, :source => :principal
has_many :enabled_modules, :dependent => :delete_all
has_many :enabled_modules, :dependent => :delete_all
has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
has_many :issues, :dependent => :destroy, :include => [:status, :tracker]
has_many :issue_changes, :through => :issues, :source => :journals