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) }