parent
4af3c9816c
commit
7961e3db6f
@ -1,7 +0,0 @@
|
|||||||
class MessageAll < ActiveRecord::Base
|
|
||||||
attr_accessible :container_id, :container_type, :message_id, :message_type
|
|
||||||
# 虚拟关联---项目消息表/课程消息表/用户留言消息表/贴吧消息表
|
|
||||||
belongs_to :message ,:polymorphic => true
|
|
||||||
# 虚拟关联---项目/课程
|
|
||||||
belongs_to :container ,:polymorphic => true
|
|
||||||
end
|
|
@ -1,10 +1,9 @@
|
|||||||
class CreateMessageAlls < ActiveRecord::Migration
|
class CreateMessageAlls < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
create_table :message_alls do |t|
|
create_table :message_alls do |t|
|
||||||
t.string :message_type
|
t.integer :user_id
|
||||||
t.integer :message_id
|
t.integer :message_id
|
||||||
t.string :container_type
|
t.string :message_type
|
||||||
t.integer :container_id
|
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
@ -1,9 +0,0 @@
|
|||||||
FactoryGirl.define do
|
|
||||||
factory :message_all do
|
|
||||||
message_type "MyString"
|
|
||||||
message_id 1
|
|
||||||
container_type "MyString"
|
|
||||||
container_id 1
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe MessageAll, :type => :model do
|
|
||||||
pending "add some examples to (or delete) #{__FILE__}"
|
|
||||||
end
|
|
Loading…
Reference in new issue