Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Reservation < ActiveRecord::Base
- belongs_to :cabin_type
- has_many :people
- def new
- raise "cabin type required" if cabin_type.nil?
- cabin_type.capacity.times do
- self.people << Person.new
- end
- end
- end
Add Comment
Please, Sign In to add comment