You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: registrations_controller.rb
    path of file: ./repos/maybe/app/controllers
    
    the code of the file until where you have to start completion: class RegistrationsController < ApplicationController
  layout "auth"

  before_action :set_user, only: :create
  before_action :claim_invite_code, only: :create, if: :
    
  def create
    family = Family.new
    @user.family = family

    if @user.save
      Transaction::Category.create_default_categories(@user.family)
      login @user
      flash[:notice] = t(".success")
      redirect_to root_path
    else
      flash[:alert] = t(".failure")
      render :new
    end