module SmartManagement
  class Searcher
    def initialize(data, options)
      @data = data
      @options = options
    end

    def call
      if @options.present?
        @options.each { |k, v| @data = @data.where("#{k} like ?", "%#{v}%") }
      end
      @data
    end
  end
end

module SmartManagement
  class Searcher
    def initialize(data, options)
      @data = data
      @options = options
    end

    def call
      if @options.present?
        @options.each do |k, v|
          @data = @data.where("#{@data.table_name}.#{k} like ?", "%#{v}%")
        end
      end
      @data
    end
  end
end

Add the table name in query
Add the table name in query
