Displaying 1 result from an estimated 1 matches for "discounted_price".
2008 Aug 25
2
maths not working (can't get this)
....old_courses
# find(:all)
# find(:all, :conditions => ["active = ?", true], :order =>
''created_at DESC'', :limit => 5)
find(:all, :conditions => {:archive => true}, :order => ''created_at
DESC'', :limit => 100)
end
def discounted_price
factor = case @duration_in_weeks
when 1..4
1.0
when 5..12
0.9
when 13..24
0.8
when 25..47
0.7
else # from 48 and up
0.6
end
total_price * factor
end
def total_price
(@duration_in_weeks * price_per_week) + registration_fee
en...