title: Is Ruby pass by reference or by value?
body: <pre><code>@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 &amp; @user.save
  end
  logger.debug "--------------------LANG_ERRORS-------------102----------" 
                  + lang_errors.full_messages.inspect
  
  if lang_errors.full_messages.empty?
  </code></pre>
  
  <p><code>@user</code> object adds errors to the <code>lang_errors</code> variable in the <code>update_lanugages</code> method.
  when I perform a save on the <code>@user</code> object I lose the errors that were initially stored in the <code>lang_errors</code> variable.</p>
  
  <p>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.</p>