diff --git a/Gemfile b/Gemfile index 1fbf1e1..0f3b34e 100644 --- a/Gemfile +++ b/Gemfile @@ -72,7 +72,7 @@ group :development, :test do gem "pry-rails" # Static analysis for security vulnerabilities [https://brakemanscanner.org/] - gem "brakeman", "~> 8.0.4", require: false + gem "brakeman", ">= 8.0.4", require: false # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] gem "rubocop-rails-omakase", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 91a8157..bd9e366 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -86,7 +86,7 @@ GEM bindex (0.8.1) bootsnap (1.18.6) msgpack (~> 1.2) - brakeman (8.0.4) + brakeman (8.0.5) racc builder (3.3.0) bullet (8.1.1) @@ -446,7 +446,7 @@ PLATFORMS DEPENDENCIES appsignal (~> 4.8, >= 4.8.4) bootsnap - brakeman (~> 8.0.4) + brakeman (>= 8.0.4) bullet (~> 8.1, >= 8.1.1) capybara csv diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 8976f09..96aa74f 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,11 +1,13 @@ class DashboardController < ApplicationController def index opportunities = current_or_demo_user.opportunities + submitted_opportunities = opportunities.where.not(application_date: nil) - @total_resumes = opportunities.where.not(application_date: nil).count + @total_resumes = submitted_opportunities.count @total_open_applications = opportunities.where(status: %w[applied interviewing]).count @total_assessed = opportunities.count - @total_interviews = InterviewSession.where(opportunity_id: opportunities.select(:id)).count + # Count interview processes, not interview rounds: 1 per submitted opportunity that has interviews. + @total_interviews = submitted_opportunities.joins(:interview_sessions).distinct.count @interview_conversion_rate = if @total_resumes.positive? ((@total_interviews.to_f / @total_resumes) * 100).round(1) else diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index 39d96f3..1fd4860 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -26,7 +26,7 @@