Relationship insert problem

Tim Perrett <rails-mailing-list@...> writes:


      address =[:delivery])
      unless! # <-- Record sucseeds validation, and
insertes a record in DB
         <at> customer =[: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