Sha256: 4f44642a6a7441c128d2d07cc3fc847210622a6cd02aa1268e51da588cdf51cd

Contents?: true

Size: 312 Bytes

Versions: 28

Compression:

Stored size: 312 Bytes

Contents

# An ad driven campaign.
#
# Unique from other campaigns in that their cost is derived from associated
# DatedCost records.
#
class AdvertisingCampaign < Campaign

  accepts_nested_attributes_for :dated_costs

  ##
  # The sum cost of this campaign
  #
  def cost
    Money.new(dated_costs.sum(:cost))
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
e9_crm-0.1.34 app/models/advertising_campaign.rb
e9_crm-0.1.33 app/models/advertising_campaign.rb
e9_crm-0.1.32 app/models/advertising_campaign.rb
e9_crm-0.1.31 app/models/advertising_campaign.rb
e9_crm-0.1.30 app/models/advertising_campaign.rb
e9_crm-0.1.29 app/models/advertising_campaign.rb
e9_crm-0.1.28 app/models/advertising_campaign.rb
e9_crm-0.1.27 app/models/advertising_campaign.rb
e9_crm-0.1.26 app/models/advertising_campaign.rb
e9_crm-0.1.25 app/models/advertising_campaign.rb
e9_crm-0.1.24 app/models/advertising_campaign.rb
e9_crm-0.1.23 app/models/advertising_campaign.rb
e9_crm-0.1.22 app/models/advertising_campaign.rb
e9_crm-0.1.21 app/models/advertising_campaign.rb
e9_crm-0.1.20 app/models/advertising_campaign.rb
e9_crm-0.1.19 app/models/advertising_campaign.rb
e9_crm-0.1.18 app/models/advertising_campaign.rb
e9_crm-0.1.17 app/models/advertising_campaign.rb
e9_crm-0.1.16 app/models/advertising_campaign.rb
e9_crm-0.1.14 app/models/advertising_campaign.rb