I am having this problem which I can't seem to get my head around. I would like some help on this.
@user.update_languages(params[:language][:language1], params[:language][:language2], params[:language][:language3])
lang_errors = @user.errors
logger.debug "--------------------LANG_ERRORS----------101-------------" + lang_errors.full_messages.inspect
if params[:user]
@user.state = params[:user][:state]
success = success & @user.save
end
logger.debug "--------------------LANG_ERRORS-------------102----------" + lang_errors.full_messages.inspect
if lang_errors.full_messages.empty?
@user object adds errors to the lang_errors variable in the update_lanugages method. when I perform a save on the @user object i lose the errors that were initially stored in the lang_errors variable.
Though what i am attempting to do would be more of a hack (which does not seem to be working). I would like to understand why the variable values are washed out. I understand pass by reference so I would like to know how the value can be held in that variable without being washed out.