parent
1b5c41b3ad
commit
cae882b3d6
|
@ -0,0 +1,5 @@
|
||||||
|
class InviteList < ActiveRecord::Base
|
||||||
|
attr_accessible :project_id, :user_id
|
||||||
|
belongs_to :user
|
||||||
|
belongs_to :project
|
||||||
|
end
|
|
@ -67,7 +67,7 @@ class Project < ActiveRecord::Base
|
||||||
has_many :student, :through => :students_for_courses, :source => :user
|
has_many :student, :through => :students_for_courses, :source => :user
|
||||||
has_one :course_extra, :class_name => 'Course', :foreign_key => :extra,:primary_key => :identifier, :dependent => :destroy
|
has_one :course_extra, :class_name => 'Course', :foreign_key => :extra,:primary_key => :identifier, :dependent => :destroy
|
||||||
has_many :applied_projects
|
has_many :applied_projects
|
||||||
|
has_many :invite_lists
|
||||||
|
|
||||||
# end
|
# end
|
||||||
#ADDED BY NIE
|
#ADDED BY NIE
|
||||||
|
|
|
@ -125,6 +125,10 @@ class User < Principal
|
||||||
has_many :documents # 项目中关联的文档再次与人关联
|
has_many :documents # 项目中关联的文档再次与人关联
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
# 邮件邀请状态
|
||||||
|
has_many :invite_lists
|
||||||
|
# end
|
||||||
|
|
||||||
######added by nie
|
######added by nie
|
||||||
has_many :project_infos, :dependent => :destroy
|
has_many :project_infos, :dependent => :destroy
|
||||||
has_one :user_status, :dependent => :destroy
|
has_one :user_status, :dependent => :destroy
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
class CreateInviteLists < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :invite_lists do |t|
|
||||||
|
t.integer :project_id
|
||||||
|
t.integer :user_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,7 @@
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :invite_list do
|
||||||
|
project_id 1
|
||||||
|
user_id 1
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe InviteList, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in New Issue