app/jobs/split_pdf_job.rb
# Determine a match using the parsed handwritten text and the user identifying field (+exam_template.cover_fields+).
# If the parsing was successful, +parsed+ is a list of two strings parsed from the handwritten text:
# the first is the result of attempting to parse alphabetic characters, and the second is the result of
# attempting to parse numeric digits.
Determine a match using the parsed handwritten text and the user identifying field (+exam_template.cover_fields+).
If the parsing was successful, +parsed+ is a list of two strings parsed from the handwritten text:
the first is the result of attempting to parse alphabetic characters, and the second is the result of
attempting to parse numeric digits.
Determine a match using the parsed handwritten text and the user identifying field ( + exam_template . cover_fields + ) . If the parsing was successful + parsed + is a list of two strings parsed from the handwritten text : the first is the result of attempting to parse alphabetic characters and the second is the result of attempting to parse numeric digits .
def match_student(parsed, exam_template)
    return if parsed.size < 2
    case exam_template.cover_fields
    when 'id_number'
      Student.joins(:end_user).find_by('end_user.id_number': parsed[1])
    when 'user_name'
      Student.joins(:end_user).find_by(EndUser.arel_table[:user_name].matches(parsed[0]))
    end
  end
def match_student ( parsed , exam_template ) return if parsed . size < 2 case exam_template . cover_fields when 'id_number' Student . joins ( :end_user ) . find_by ( 'end_user.id_number' : parsed [ 1 ] ) when 'user_name' Student . joins ( :end_user ) . find_by ( EndUser . arel_table [ :user_name ] . matches ( parsed [ 0 ] ) ) end end
Determine a match using the parsed handwritten text and the user identifying field (+exam_template.cover_fields+).
Determine a match using the parsed handwritten text and the user identifying field ( + exam_template . cover_fields + ) .
parsed
<not_specific>
exam_template
<not_specific>