2
我目前正在爲我的網站開發郵件系統。如何在郵件中分隔cc和bcc?
到目前爲止,該文件是這樣的:
/app/models/user.rb
has_many :user_chats
has_many :chats, :through => :user_chats
has_many :messages, :through => :chats
/app/models/user_chat.rb
belongs_to :user
belongs_to :chat
has_many :messages, :through => :chats
/應用/型號/chat.rb
has_many :user_chats
has_many :users, :through => :user_chats
has_many :messages
所以現在我可以g et所有用戶通過@ chat.users參與聊天
但是我怎樣才能分開兩組用戶?收件人和密件抄送收件人。
我想過爲user_chat模型添加一個bbc:boolean。你們有什麼感想?
好了,謝謝!我剛剛嘗試過,並遇到另一個問題。你會如何設置國旗?目前我正通過'conversation.user_ids = ids'將用戶添加到對話中。 'id'是一個用戶id的數組。 – Cojones 2012-01-18 20:08:32
增加了更多信息。 – 2012-01-18 20:22:47
Btw嘗試使用Ruby 1.9哈希語法。它更容易閱讀:'has_many:bbc_users,通過::user_chats,條件:{bbc:true}' – 2012-01-18 20:23:34