Class: SalesCampaign

Inherits:
Campaign
  • Object
show all
Defined in:
app/models/sales_campaign.rb

Overview

An sales campaign

Carries an affiliate fee

Direct Known Subclasses

AffiliateCampaign

Instance Method Summary collapse

Methods inherited from Campaign

default, #new_visit_count, #new_visit_page_view_count, #repeat_visit_count, #repeat_visit_page_view_count, #to_liquid, #to_s

Instance Method Details

#costObject

The sum cost of this campaign



14
15
16
# File 'app/models/sales_campaign.rb', line 14

def cost
  sales_fee
end

#set_cost(options = {}) ⇒ Object



18
19
20
21
# File 'app/models/sales_campaign.rb', line 18

def set_cost(options = {})
  dated_costs.clear
  dated_costs.create(options.merge(:cost => cost))
end