Class: StudyReport
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- StudyReport
- Extended by:
- DbFile::Uploader
- Defined in:
- app/models/study_report.rb
Overview
A spreadsheet summarising the QC information about a study. Generally replaced by QcReport which adds support for pass/fail criteria, automatic decisions and customer decisions.
Defined Under Namespace
Modules: AssetDetails, StudyDetails, WellDetails Classes: ProcessingError
Instance Method Summary collapse
Methods included from DbFile::Uploader
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Instance Method Details
#headers ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/models/study_report.rb', line 22 def headers [ 'Study', 'Sample Name', 'Plate', 'Supplier Volume', 'Supplier Concentration', 'Supplier Sample Name', 'Supplier Gender', 'Concentration', 'Sequenome Count', 'Sequenome Gender', 'Pico', 'Gel', 'Qc Status', 'Genotyping Status', 'Genotyping Chip', 'Is in Fluidigm' ] end |
#perform ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/models/study_report.rb', line 43 def perform ActiveRecord::Base.transaction do = { row_sep: "\r\n", force_quotes: true } Tempfile.open("#{study.dehumanise_abbreviated_name}_progress_report.csv") do |tempfile| Study .find(study_id) .progress_report_on_all_assets { |fields| tempfile.puts(CSV.generate_line(fields, **)) } tempfile.open # Reopen the temporary file update!(report: tempfile) end end end |
#priority ⇒ Object
60 61 62 |
# File 'app/models/study_report.rb', line 60 def priority configatron.delayed_job.fetch(:study_report_priority, 100) end |
#schedule_report ⇒ Object
56 57 58 |
# File 'app/models/study_report.rb', line 56 def schedule_report Delayed::Job.enqueue StudyReportJob.new(id), priority: end |