Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FinancingPeriod < ActiveRecord::Base
- extend ActiveSupport::Memoizable
- belongs_to :event
- has_many :financings, :dependent => :destroy
- named_scope :current, lambda { |year| {:order => :date, :conditions => ['YEAR(date) = ?', year || Time.now.year.to_int] } }
- def planned_federal_financing
- financings.sum(&:planned_federal_financing)
- end
- memoize :planned_federal_financing
- end
Add Comment
Please, Sign In to add comment