department-of-veterans-affairs / caseflow

Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans' Appeals.
Other
54 stars 18 forks source link

Prepare tasks job | Appeals with more than 0 documents break the job #3838

Closed ghost closed 6 years ago

ghost commented 6 years ago

Description

When Prepared Tasks job runs or I access documents attribute on an appeal, for some reason I get an ActiveRecord error

Reproduction Steps

Scenario 1 -

  1. Go to rails console.
  2. Task.all.sample.appeal.documents until you get more than 0 documents for an appeal
  3. Observe error
  4. Try to run Prepare tasks job
  5. Observe failure

Validated in the following Environment(s)

Logs:

Document list length: 1
ActiveRecord::SubclassNotFound: Invalid single-table inheritance type: Appeal Checklist is not a subclass of Document
        from /opt/caseflow-certification/src/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.7.1/lib/active_record/inheritance.rb:215:in `subclass_from_attributes'
        from /opt/caseflow-certification/src/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.7.1/lib/active_record/inheritance.rb:55:in `new'
        from /opt/caseflow-certification/src/app/models/document.rb:88:in `from_vbms_document'
        from /opt/caseflow-certification/src/app/services/external_api/vbms_service.rb:50:in `block in fetch_documents_for'
        from /opt/caseflow-certification/src/app/services/external_api/vbms_service.rb:50:in `map'
        from /opt/caseflow-certification/src/app/services/external_api/vbms_service.rb:50:in `fetch_documents_for'
        from /opt/caseflow-certification/src/app/models/appeal.rb:466:in `fetch_documents_from_service!'
        from /opt/caseflow-certification/src/app/models/appeal.rb:474:in `fetched_documents'
        from /opt/caseflow-certification/src/app/models/appeal.rb:293:in `fetch_documents!'
        from /opt/caseflow-certification/src/app/models/appeal.rb:95:in `documents'

Sentry:

n/a

Screenshots

Scenario 1 - [TITLE]

ghost commented 6 years ago

NEvermind I have no understanding why this is working now