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: account_confirmations_controller.rb
    path of file: ./repos/spree_auth_devise/app/controllers/spree/api/v2/storefront
    
    the code of the file until where you have to start completion: module Spree
  modu
    
          def show
            user = Spree.user_class.confirm_by_token(params[:id])

            if user.errors.empty?
              render json: { data: { state: user.respond_to?(:state) ? user.state : '' } }, status: :ok
            else
              render json: { error: user.errors.full_messages.to_sentence }, status: :unprocessable_entity
            end