app/controllers/account_controller.rb
def register_automatically(user, opts = {})
    if user_limit_reached?
      show_user_limit_activation_error!
      send_activation_limit_notification_about user

      return redirect_back fallback_location: signin_path
    end

    # Automatic activation
    user.activate

    if user.save
      stages = authentication_stages after_activation: true

      run_registration_stages stages, user, opts
    else
      yield if block_given?
    end
  end
# Automatically register a user
#
# Pass a block for behavior when a user fails to save
Automatically register a user
Pass a block for behavior when a user fails to save
Automatically register a user Pass a block for behavior when a user fails to save
def register_automatically(user, opts = {})
    if user_limit_reached?
      show_user_limit_activation_error!
      send_activation_limit_notification_about user
      return redirect_back fallback_location: signin_path
    end
    user.activate
    if user.save
      stages = authentication_stages after_activation: true
      run_registration_stages stages, user, opts
    else
      yield if block_given?
    end
  end
def register_automatically ( user , opts = { } ) if user_limit_reached? show_user_limit_activation_error! send_activation_limit_notification_about user return redirect_back fallback_location : signin_path end user . activate if user . save stages = authentication_stages after_activation : true run_registration_stages stages , user , opts else yield if block_given? end end
Automatically register a user
Pass a block for behavior when a user fails to save
Automatically register a user Pass a block for behavior when a user fails to save
# Automatic activation
user
opts