Guest User

Untitled

a guest
Feb 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class ProgramEvent < ActiveRecord::Base
  2.  
  3. has_many :entrance_fees
  4.  
  5. # Complex forms quite complicated, huh?
  6. def entrance_fees=(options)
  7. options.each do |new_entrance_fee|
  8. if entrance_fee = ProgramEntranceFee.create( new_entrance_fee )
  9. self.entrance_fees << entrance_fee
  10. end if new_entrance_fee[:price] && !new_entrance_fee[:price].blank?
  11. end
  12. end
  13.  
  14. end
Add Comment
Please, Sign In to add comment