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: tables_controller.rb
    path of file: ./repos/SalorHospitality/salor-hospitality/app/controllers
    
    the code of the file until where you have to start completion: # coding: UTF-8

# Copyright (c) 2012 Red (E) Tools Ltd.
#
# Permission is hereby granted, free of charge, to any perso
    
  def destroy
    @table = get_model
    redirect_to tables_path and return unless @table
    if @table.active_user_id
      flash[:error] = "This table has an open order. Cannot delete."
      redirect_to tables_path
      return
    end