Sha256: 59d4642f02945121d21fa6f1c07b50e97f37254dd5b0461cc765e49ecdfd4f04
Contents?: true
Size: 831 Bytes
Versions: 6
Compression:
Stored size: 831 Bytes
Contents
module Mokio module Concerns module Models # # Concern for Contact model # module Contact extend ActiveSupport::Concern included do has_many :recipients, dependent: :destroy has_one :contact_template, dependent: :destroy accepts_nested_attributes_for :recipients accepts_nested_attributes_for :contact_template # delegate :tpl, to: :contact_template end # # Get recipient_id's for given email # def recipient_emails=(emails) self.recipient_ids = Mokio::Recipient.ids_from_emails(emails) end # # Return recipient emails # def recipient_emails self.recipients.map(&:email).join(',') end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems