title: Rails Sidekiq Queue size not working
body: <p>I have a Rails app with 2 jobs (ImportCsvJob and ProcessCsvJob). So that I can visibly hint in the app that there are still jobs in the queue I have this helper method (inside application_helper.rb):</p>
  
  <pre><code>module ApplicationHelper
     def queued_job_count
          Sidekiq::Queue.new.size
      end
  end
  </code></pre>
  
  <p>Then I use it on my index controller which is then passed to the view for processing and giving the visual hint in the app.</p>
  
  <pre><code>  def index
      @still_have_jobs = !queued_job_count.zero?
    end
  </code></pre>
  
  <p>However, this works when I still had 1 background Job (ImportCsvJob), but when I added the (ProcessCsvJob) it does not work anymore.</p>
  
  <p><strong>import_csv_job.rb</strong></p>
  
  <pre><code>require 'open-uri'
  
  class ImportCsvJob &lt; ActiveJob::Base
    queue_as :default
  
    def perform(csv_record)
      csv_record[:object_changes] = ApplicationController.helpers.generate_hash(csv_record[:object_changes])
      ObjectRecord.create(csv_record)
    end
  end
  </code></pre>
  
  <p><strong>process_csv_job.rb</strong></p>
  
  <pre><code>class ProcessCsvJob &lt; ActiveJob::Base
    queue_as :default
  
    def perform(csv_path)
      csv_file = open(csv_path,'rb:UTF-8')
  
      options = {
          row_sep: :auto, col_sep: ",", 
          user_provided_headers: [:object_id, :object_type, :timestamp, :object_changes], 
          remove_empty_values: true, 
          headers_in_file: true
      }
  
      SmarterCSV.process(csv_file, options) do |array|
          ImportCsvJob.perform_later(array.first)
      end
    end
  
  end
  </code></pre>
  
  <p>and lastly, in the model where this is called:</p>
  
  <pre><code>ProcessCsvJob.perform_later(gdrive.uploaded_file_link)
  </code></pre>
  
  <p>When I try to debug in Rails console using Sidekiq::Queue.new.size, it still gives out 0.</p>
  
  <p>Running:</p>
  
  <pre><code>redis-server
  bundle exec sidekiq
  </code></pre>