Merge pull request #138 from houdiniproject/merged_into

Add merged_into association for Supporter
This commit is contained in:
Eric Schultz 2019-01-23 11:11:02 -06:00 committed by GitHub
commit e1cef5be21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,6 +48,7 @@ class Supporter < ActiveRecord::Base
has_many :tag_masters, through: :tag_joins
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'
validates :nonprofit, :presence => true
scope :not_deleted, -> {where(deleted: false)}