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: items_controller.rb
    path of file: ./repos/circulate/app/controllers
    
    the code of the file until where you have to start completion: class ItemsController < Applicatio
    
  def filter_by_query(item_scope)
    @query = filter_params[:query].to_s.strip.presence

    return item_scope unless @query

    if @query.size < 3
      flash.now[:warning] = "You must provide at least three numbers or letters to search by."
      filter_params.delete(:query)
      return item_scope
    end