Add Campaign.get_campaign_and_children

This commit is contained in:
Eric 2020-06-18 15:46:47 -05:00 committed by Eric Schultz
parent 1c80f48a3e
commit ea049c43b5

View file

@ -190,4 +190,9 @@ class Campaign < ApplicationRecord
def parent_campaign?
!child_campaign?
end
def self.get_campaign_and_children(campaign)
where('campaigns.id = ? OR campaigns.parent_campaign_id = ? ',campaign, campaign)
end
end