<commit_before>class RegistrationsController < Devise::RegistrationsController
  def create
    super
    session[:omniauth] = nil unless @user.new_record?
    Mailer.send_welcome_message(@user).deliver unless @user.new_record?
  end

  def update
    if params[:preview]
      resource.display_email = params[:user][:display_email] == '1'
      render :action => 'edit'
    else
      @user = User.friendly.find(current_user.friendly_id)
      @user.skill_list = params[:user].delete "skill_list" # Extracts skills from params
      account_update_params = devise_parameter_sanitizer.sanitize(:account_update)

      if @user.update_attributes(account_update_params)
        set_flash_message :notice, :updated
        redirect_to after_update_path_for(@user)
      else
        render :edit
      end
    end
  end

  private

  def build_resource(*args)
    super
    if session[:omniauth]
      @user.apply_omniauth(session[:omniauth])
      @user.valid?
    end
  end

  def after_update_path_for(resource)
    user_path(resource)
  end
end<commit_msg>Replaced super with the method definion in build_resource<commit_after>class RegistrationsController < Devise::RegistrationsController
  def create
    super
    session[:omniauth] = nil unless @user.new_record?
    Mailer.send_welcome_message(@user).deliver unless @user.new_record?
  end

  def update
    if params[:preview]
      resource.display_email = params[:user][:display_email] == '1'
      render :action => 'edit'
    else
      @user = User.friendly.find(current_user.friendly_id)
      @user.skill_list = params[:user].delete "skill_list" # Extracts skills from params
      account_update_params = devise_parameter_sanitizer.sanitize(:account_update)

      if @user.update_attributes(account_update_params)
        set_flash_message :notice, :updated
        redirect_to after_update_path_for(@user)
      else
        render :edit
      end
    end
  end

  private

  def build_resource(hash=nil)
    self.resource = User.new_with_session(hash || {}, session)
    if session[:omniauth]
      @user.apply_omniauth(session[:omniauth])
      @user.valid?
    end
  end

  def after_update_path_for(resource)
    user_path(resource)
  end
end

{'fraction_non_alphanumeric': 0.08939051918735892, 'fraction_numerical': 0.0009029345372460496, 'mean_word_length': 3.5975103734439835, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3006421', 'n_tokens_mistral': 694, 'n_tokens_neox': 676, 'n_words': 136}