新增邮件状态表

相关关联
This commit is contained in:
huang 2015-05-28 14:44:04 +08:00
parent 1b5c41b3ad
commit cae882b3d6
6 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,5 @@
class InviteList < ActiveRecord::Base
attr_accessible :project_id, :user_id
belongs_to :user
belongs_to :project
end

View File

@ -67,7 +67,7 @@ class Project < ActiveRecord::Base
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_many :applied_projects
has_many :invite_lists
# end
#ADDED BY NIE

View File

@ -125,6 +125,10 @@ class User < Principal
has_many :documents # 项目中关联的文档再次与人关联
# end
# 邮件邀请状态
has_many :invite_lists
# end
######added by nie
has_many :project_infos, :dependent => :destroy
has_one :user_status, :dependent => :destroy

View File

@ -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

View File

@ -0,0 +1,7 @@
FactoryGirl.define do
factory :invite_list do
project_id 1
user_id 1
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe InviteList, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end