Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ProgramEvent < ActiveRecord::Base
- has_many :entrance_fees
- # Complex forms quite complicated, huh?
- def entrance_fees=(options)
- options.each do |new_entrance_fee|
- if entrance_fee = ProgramEntranceFee.create( new_entrance_fee )
- self.entrance_fees << entrance_fee
- end if new_entrance_fee[:price] && !new_entrance_fee[:price].blank?
- end
- end
- end
Add Comment
Please, Sign In to add comment