<commit_before>class RegistrationsController < Devise::RegistrationsController

  def new
    super
    session[:registration_params] ||= {}
    puts "allasdfhalsidfhaksdfhlkahjskdfhlkashlkdfhlsaf"
    puts resource # = @user...
  end

  def create
    session[:registration_params].deep_merge! sign_up_params if sign_up_params
    @user = build_resource(session[:registration_params])

    @user.registration_step = session[:registration_step]

    if params[:back_button]
      @user.previous_registration_step
    elsif @user.last_step?
      # todo: validations....
      session[:registration_params] = session[:registration_step] = nil
      return super
    else
      @user.next_registration_step
    end
    
    session[:registration_step] = @user.registration_step
    render 'new'
  end

  # prepend_before_filter :require_no_authentication, :only => [ :cancel ]<commit_msg>hacky validation for last register step<commit_after>class RegistrationsController < Devise::RegistrationsController

  def new
    super
    session[:registration_params] ||= {}
    puts "allasdfhalsidfhaksdfhlkahjskdfhlkashlkdfhlsaf"
    puts resource # = @user...
  end

  def create
    session[:registration_params].deep_merge! sign_up_params if sign_up_params
    @user = build_resource(session[:registration_params])

    @user.registration_step = session[:registration_step]

    if params[:back_button]
      @user.previous_registration_step
    elsif @user.last_step?
      if @user.valid?
        # todo: validations....
        session[:registration_params] = session[:registration_step] = nil
        return super
      end
    else
      @user.next_registration_step
    end
    
    session[:registration_step] = @user.registration_step
    render 'new'
  end

  # prepend_before_filter :require_no_authentication, :only => [ :cancel ]
{'fraction_non_alphanumeric': 0.08986928104575163, 'fraction_numerical': 0.0, 'mean_word_length': 3.8342105263157893, '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': '7238484', 'n_tokens_mistral': 575, 'n_tokens_neox': 542, 'n_words': 102}