Created
January 22, 2012 19:54
-
-
Save ream88/1658495 to your computer and use it in GitHub Desktop.
How to separate cc and bcc in messages?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Chat < ActiveRecord::Base | |
has_many :user_chats, conditions: { bbc: false } | |
has_many :bbc_user_chats, class_name: 'UserChat', conditions: { bbc: true } | |
has_many :users, through: :user_chats | |
has_many :bbc_users, through: :bbc_user_chats, source: :user | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
has_many :user_chats | |
has_many :chats, through: :user_chats | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserChat < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :chat | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment