Open arouault opened 7 years ago
@mzagaja is going to migrate the Return Candidates into its own model, and we will have to outer join applicants with return_candidates.
See https://github.com/MAPC/youth-match-v2/issues/59 for additional context on this issue on the back end side. Basically we've settled on only showing candidates that actually applied. My general sense is that you're probably calling the applicants endpoint to show the CBO the potential applicants, but I wanted to get further context on how we want to get this working. I am considering a scope scope :with_rehire_information, -> { select("applicants.*", "rehire_sites.*").joins("LEFT JOIN rehire_sites ON applicants.icims_id = rehire_sites.icims_id") }
in applicant.rb that will append the rehire site information. The only open question in my mind remains how we're actually going to constrain highlighting to the CBO's that a person they are looking at worked for them in the past.
Given the scope mentioned earlier you should be able to compare applicant.site_name
to the currently logged in CBO site name. We can say that User has_one :rehire_site
, and the the rehire_site belongs_to :user
. Then check current_user.rehire_site.site_name == applicant.site_name
in the view and if it is the case we highlight it or set text in the column to true or checkmark or something. Does that make sense?
Present data from the CBO return selector table: https://dyee.pagefrontapp.com/return-survey
Showing if an applicant is a returning candidate or not