webdev.camp/app/models/apply.rb

16 lines
498 B
Ruby
Raw Normal View History

2016-05-17 16:50:58 +02:00
class Apply < ActiveRecord::Base
2016-11-05 09:28:02 +01:00
PLANS = { standard: "2100¢ - 8 week prepayment, no cancellation" ,
2016-05-19 15:17:33 +02:00
flex: "2400¢ - 8 week prepayment, 2 week cancellation" ,
super_flex: "2900¢ - 2 week prepayment, stop anytime" }
2016-05-17 16:50:58 +02:00
belongs_to :user
belongs_to :primary_choice_course , class_name: :Course
belongs_to :secondary_choice_course , class_name: :Course
2016-05-17 16:50:58 +02:00
validates_presence_of :primary_choice_course_id
2016-05-19 15:17:33 +02:00
def plan_name
PLANS[self.plan.to_sym]
end
2016-05-17 16:50:58 +02:00
end