app/models/advertising_campaign.rb in e9_crm-0.1.4 vs app/models/advertising_campaign.rb in e9_crm-0.1.5
- old
+ new
@@ -3,9 +3,11 @@
# 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))