Supporters now have a merged_from attribute to get the Supporter records that were merged into this given Supporter
This commit is contained in:
parent
9b3aee8f71
commit
502abde5ee
1 changed files with 1 additions and 0 deletions
|
@ -50,6 +50,7 @@ class Supporter < ApplicationRecord
|
||||||
has_many :custom_field_joins, dependent: :destroy
|
has_many :custom_field_joins, dependent: :destroy
|
||||||
has_many :custom_field_masters, through: :custom_field_joins
|
has_many :custom_field_masters, through: :custom_field_joins
|
||||||
belongs_to :merged_into, class_name: 'Supporter', foreign_key: 'merged_into'
|
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
|
validates :nonprofit, presence: true
|
||||||
scope :not_deleted, -> { where(deleted: false) }
|
scope :not_deleted, -> { where(deleted: false) }
|
||||||
|
|
Loading…
Reference in a new issue