Tim Perrett <rails-mailing-list@...> writes:
address = CustomerAddress.new(params[:delivery])
unless address.save! # <-- Record sucseeds validation, and
insertes a record in DB
<at> customer = Customer.new(params[:customer])
<at> customer.customer_addresses = address # <-- this is the
problem line where the 'each' exception is comming from.
rescue => <at> error
flash[:notice] = 'Could not be saved.'
flash[:notice] = 'address not valid in model'
for a has_one:
customer.customer_address = address
for a has_many:
customer.customer_addresses << address
where << is usually used to append something (address) to something else