From 502abde5ee842080aa9b3523a3cd35d09d1f89d5 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 23 Jun 2020 15:31:25 -0500 Subject: [PATCH] Supporters now have a merged_from attribute to get the Supporter records that were merged into this given Supporter --- app/models/supporter.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/supporter.rb b/app/models/supporter.rb index 0f2704c5..38a584c2 100644 --- a/app/models/supporter.rb +++ b/app/models/supporter.rb @@ -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) }