I'm having the worst time with 1 block of my app lol.
I have an address model with many validations.
I run this code on a 4 model form. If the params for the adresses are
blank (not valid) or just not valid the objects should not be created
and neither should the user or dealer. But both the user and dealer
are being saved and the addresses are throwing no validation errors. I
know the model is valid as i've unit tested it thoroughly. Why are the
validations not being processed on create. I've read the differences
for new-vs-create-vs-build but it sounds like build associations
should run validations.
params[:mailing_address] ||= 
params[:billing_address] ||= 
@dealer = Dealer.new(params[:dealer])
@user = @dealer.users.new(params[:user])
@user.roles << Role.find(3)