From 0ad9181533a71dcb39d860508819b547fb48c2c6 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Wed, 21 Nov 2018 17:23:25 -0600 Subject: [PATCH] If a campaign is done, P2P campaign link is for the nonprofit, not the campaign --- app/models/campaign.rb | 3 +++ app/views/campaigns/show.html.erb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/campaign.rb b/app/models/campaign.rb index d532a312..c4c64669 100644 --- a/app/models/campaign.rb +++ b/app/models/campaign.rb @@ -164,6 +164,9 @@ class Campaign < ActiveRecord::Base (self.end_datetime.to_date - Date.today).to_i end + def finished? + self.end_datetime && self.end_datetime < Time.now + end def child_params excluded_for_peer_to_peer = %w( diff --git a/app/views/campaigns/show.html.erb b/app/views/campaigns/show.html.erb index 159d1b32..23deeed3 100644 --- a/app/views/campaigns/show.html.erb +++ b/app/views/campaigns/show.html.erb @@ -87,7 +87,7 @@ <% if !@campaign.child_campaign? %>