added services
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
class MailRecipient < ApplicationRecord
|
||||
belongs_to :received_mail
|
||||
belongs_to :recipient
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
class ReceivedMail < ApplicationRecord
|
||||
belongs_to :sender
|
||||
has_many :mail_recipients
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
class Recipient < ApplicationRecord
|
||||
has_many :emails, foreign_key: :recipient_id, class_name: 'MailRecipient'
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
class Sender < ApplicationRecord
|
||||
has_many :sent_mails, foreign_key: :sender_id, class_name: 'ReceivedMail'
|
||||
end
|
||||
Reference in New Issue
Block a user