Add Campaign.get_campaign_and_children
This commit is contained in:
parent
1c80f48a3e
commit
ea049c43b5
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue