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: tabular.rb
    path of file: ./repos/stimulus_reflex_expo/app/controllers/concerns
    
    the code of the file until where you have to start completion: module Tabular
  extend ActiveSupport::Concern
  include Pagy::Backend

  protected

  def prepare_variables
    @query = params[:query]
    @order_by = permitted_col
    
  def prepare_variables
    @query = params[:query]
    @order_by = permitted_column_name(params[:order_by])
    @direction = permitted_direction(params[:direction])

    restaurants = Restaurant.order(@order_by => @direction)
    restaurants = restaurants.search(@query) if @query.present?
    page_count = (restaurants.count / Pagy::VARS[:items].to_f).ceil

    @page = (params[:page] || 1).to_i
    @page = page_count if @page > page_count
    @page = 1 if @page < 1
    @pagy, @restaurants = pagy(restaurants, page: @page)
  end