user.save not saving?

Ben Jackson
Sat, 28 May 2005 19:54:05 -0000

I have a controller definition to complete a form and send a
confirmation email:

> 	def complete
> 		if @session[''user'']
>     			@user =
User.find(@session[''user''][''id''])
> 	    		if @user.update_attributes(@params[:user])
> 	      			flash[''notice''] = ''Thank
you.''
> 	    		end
>
>     		else
>     			@user = User.new(@params[:user])
>     			@user.pass = @user.random_pass
> 					@user.login = @params["user"]["login"]
>     			if @user.save
>     				flash[''notice''] = ''Thank you.''
>     			end
>     		end
> 		Mailer::deliver_complete( User.find(@user.id) , @survey)
> 	end

If the user has been created and is already logged in, it updates fine.
However

>     			if @user.save
>     				flash[''notice''] = ''Thank you.''
>     			end

Is not being executed. Adding new users through the admin system is
functional. What could be going wrong? Thanks,
___________________
Ben Jackson
Diretor de Desenvolvimento

ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org