Supporters now have a merged_from attribute to get the Supporter records that were merged into this given Supporter

This commit is contained in:
Eric 2020-06-23 15:31:25 -05:00 committed by Eric Schultz
parent 9b3aee8f71
commit 502abde5ee

View file

@ -50,6 +50,7 @@ class Supporter < ApplicationRecord
has_many :custom_field_joins, dependent: :destroy
has_many :custom_field_masters, through: :custom_field_joins
belongs_to :merged_into, class_name: 'Supporter', foreign_key: 'merged_into'
has_many :merged_from, class_name: 'Supporter', :foreign_key => "merged_into"
validates :nonprofit, presence: true
scope :not_deleted, -> { where(deleted: false) }