Sha256: 731220de8b14bfe0b90fa7c2698050e6ace0c394879b104d7da019258aa1fc1a
Contents?: true
Size: 417 Bytes
Versions: 16
Compression:
Stored size: 417 Bytes
Contents
module Contacts extend ActiveSupport::Concern included do has_many :contacts, as: :contactable has_one :primary_contact, -> { where(primary: true) }, class_name: 'Gaku::Contact', as: :contactable # def primary_contact # contacts.where(primary: true).first # end def contact_widget "#{primary_contact.contact_type}: #{primary_contact.data}" if primary_contact end end end
Version data entries
16 entries across 16 versions & 2 rubygems