Skip to content

Instantly share code, notes, and snippets.

@domagude
Last active November 16, 2017 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domagude/d919da8ba4bcfa034d100546aba33015 to your computer and use it in GitHub Desktop.
Save domagude/d919da8ba4bcfa034d100546aba33015 to your computer and use it in GitHub Desktop.
...
has_many :messages,
class_name: "Private::Message",
foreign_key: :conversation_id
belongs_to :sender, foreign_key: :sender_id, class_name: 'User'
belongs_to :recipient, foreign_key: :recipient_id, class_name: 'User'
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment