Nonprofit page now only shows non-child campaigns
This commit is contained in:
parent
6e77a98bff
commit
3d1fac1655
2 changed files with 2 additions and 1 deletions
|
@ -19,7 +19,7 @@
|
||||||
@profiles = @nonprofit.profiles.order('total_raised DESC').limit(5).includes(:user).uniq
|
@profiles = @nonprofit.profiles.order('total_raised DESC').limit(5).includes(:user).uniq
|
||||||
|
|
||||||
events = @nonprofit.events.not_deleted.order('start_datetime desc')
|
events = @nonprofit.events.not_deleted.order('start_datetime desc')
|
||||||
campaigns = @nonprofit.campaigns.not_deleted.order('created_at desc')
|
campaigns = @nonprofit.campaigns.not_deleted.not_a_child.order('created_at desc')
|
||||||
|
|
||||||
@events = events.upcoming
|
@events = events.upcoming
|
||||||
@any_past_events = events.past.any?
|
@any_past_events = events.past.any?
|
||||||
|
|
|
@ -76,6 +76,7 @@ class Campaign < ActiveRecord::Base
|
||||||
scope :unpublished, -> {where(:published => [nil, false])}
|
scope :unpublished, -> {where(:published => [nil, false])}
|
||||||
scope :not_deleted, -> {where(deleted: [nil, false])}
|
scope :not_deleted, -> {where(deleted: [nil, false])}
|
||||||
scope :deleted, -> {where(deleted: true)}
|
scope :deleted, -> {where(deleted: true)}
|
||||||
|
scope :not_a_child, -> {where(parent_campaign_id: nil)}
|
||||||
|
|
||||||
before_validation do
|
before_validation do
|
||||||
if self.goal_amount_dollars.present?
|
if self.goal_amount_dollars.present?
|
||||||
|
|
Loading…
Add table
Reference in a new issue