added services

This commit is contained in:
Mike Sutton
2022-11-16 01:02:18 +01:00
parent 329e66c949
commit 9d256dfcba
52 changed files with 1419 additions and 0 deletions

View File

View File

@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

View File

View File

@ -0,0 +1,4 @@
class MailRecipient < ApplicationRecord
belongs_to :received_mail
belongs_to :recipient
end

View File

@ -0,0 +1,4 @@
class ReceivedMail < ApplicationRecord
belongs_to :sender
has_many :mail_recipients
end

View File

@ -0,0 +1,3 @@
class Recipient < ApplicationRecord
has_many :emails, foreign_key: :recipient_id, class_name: 'MailRecipient'
end

View File

@ -0,0 +1,3 @@
class Sender < ApplicationRecord
has_many :sent_mails, foreign_key: :sender_id, class_name: 'ReceivedMail'
end