Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
877d8c9
build: remove unused pysch dependency
StephenHulme Apr 10, 2026
960f766
revert: restore deleted file - turns out it is used
StephenHulme Apr 10, 2026
604d5d6
fix: update usages of unsafe loading for controlled files
StephenHulme Apr 27, 2026
bfcc871
Merge branch 'develop' into sh51/remove-pysch-dependency
StephenHulme Apr 27, 2026
c40e26f
Merge branch 'develop' into sh51/remove-pysch-dependency
StephenHulme Apr 29, 2026
9892364
test: add descriptive context to bulk submission specs
StephenHulme Apr 29, 2026
2890168
fix: update YAML file loading functions
StephenHulme Apr 29, 2026
6f880c8
fix: allow the use of unsafe loading in Psych 4, same behaviour as in 3
StephenHulme Apr 29, 2026
f99987c
stlye: lint
StephenHulme Apr 29, 2026
aa5f96c
fix: allow symbol loading for accessioning tags
StephenHulme Apr 29, 2026
8e6f07e
fix: preview against latest record_loader beta version
StephenHulme Apr 30, 2026
b8ebbfe
fix: remove unrequired commas from asset_shapes
StephenHulme Apr 30, 2026
a28b173
security: be stricter in what files are unsafe_loaded
StephenHulme Apr 30, 2026
dcc7da5
fix: allow symbol loading for excel helpers
StephenHulme Apr 30, 2026
5f4d038
fix: allow aliases for excel helper
StephenHulme Apr 30, 2026
08fff5b
fix: allow HashWithIndifferentAccess loading for request options loading
StephenHulme Apr 30, 2026
a6b82fc
fix: allow request type serialization
StephenHulme Apr 30, 2026
ba92944
fix: allow additional request type serialization
StephenHulme Apr 30, 2026
6846d27
fix: allow primer programs serialization
StephenHulme Apr 30, 2026
544c06c
fix: allow broadcase_event serialization
StephenHulme Apr 30, 2026
c40fd04
fix: alllow loading of request options behaviour
StephenHulme Apr 30, 2026
7bb8f07
fix: allow tag_layout serialization
StephenHulme May 1, 2026
a6969d1
fix: allow Time for request options behaviour
StephenHulme May 1, 2026
aba4e20
security: allow HashWithIndifferentAccess to be loaded by default
StephenHulme May 5, 2026
26c9a5b
revert: add HashWithIndifferentAccess back to non-ActiveRecord loading
StephenHulme May 5, 2026
33481a0
fix: remove already-permitted HashWithIndifferentAccess
StephenHulme May 5, 2026
f61d322
fix: allow request options behaviour to load ActiveSupport::TimeZone
StephenHulme May 5, 2026
49b7688
fix: allow request options behaviour to load aliases
StephenHulme May 5, 2026
d462070
style: lint
StephenHulme May 5, 2026
582847e
style: update rubocop todo
StephenHulme May 5, 2026
adf8be8
Merge branch 'develop' into sh51/remove-pysch-dependency
StephenHulme May 5, 2026
ec6d69c
wip(qc_report): adds plate barcodes to qc report model
BenTopping May 6, 2026
02f3dd3
feat(qc_report): adds plate_barcodes to qc_report
BenTopping May 7, 2026
65a4992
feat(qc_report): remove requirement for study if plate_barcodes are p…
BenTopping May 7, 2026
0888738
feat(qc_report): moves well calculations to Well model from Study, ad…
BenTopping May 8, 2026
0510ac1
chore: merges in develop
BenTopping May 8, 2026
4b1b70d
fix(qc_report): validate study instead of study_id
BenTopping May 8, 2026
c03712a
feat(qc_report): removes default plate_purposes if plate_barcodes are…
BenTopping May 11, 2026
851d4e4
fix(qc_report): remove further dependency on study
BenTopping May 11, 2026
40210f5
Merge branch 'develop' into sh51/remove-pysch-dependency
StephenHulme May 11, 2026
06e84a2
build: upgrade to record_loader 1.0.0
StephenHulme May 11, 2026
fb407d9
build: upgrade to record_loader 1.1.0
StephenHulme May 11, 2026
4eef83b
Update knapsack_pro to version 10.0.0
depfu[bot] May 11, 2026
db94bcf
Update postcss to version 8.5.14
depfu[bot] May 11, 2026
ebbc9e1
Update vite_rails to version 3.11.0
depfu[bot] May 12, 2026
b6e01dd
Update vite-plugin-ruby to version 5.2.2
depfu[bot] May 12, 2026
efb7224
Merge branch 'develop' into sh51/remove-pysch-dependency
StephenHulme May 14, 2026
e6d130b
misc: adds placeholder to qc_report plate_barcodes_text, removes redu…
BenTopping May 14, 2026
1248fc8
fix: make seed data as explicitly safe
StephenHulme May 14, 2026
5135da8
Merge branch 'develop' into sh51/remove-pysch-dependency
StephenHulme May 14, 2026
fe514ba
Merge pull request #5776 from sanger/depfu/update/vite_rails-3.11.0
StephenHulme May 14, 2026
a754e6f
Merge pull request #5777 from sanger/depfu/update/yarn/vite-plugin-ru…
StephenHulme May 14, 2026
b29f9b5
Update faraday to version 2.14.2
depfu[bot] May 18, 2026
334d7f0
Merge pull request #5681 from sanger/sh51/remove-pysch-dependency
StephenHulme May 19, 2026
5f1bdb0
Update vitest to version 4.1.6
depfu[bot] May 19, 2026
5dbe0bf
Merge pull request #5787 from sanger/depfu/update/faraday-2.14.2
StephenHulme May 20, 2026
8658e3d
Merge pull request #5790 from sanger/depfu/update/yarn/vitest-4.1.6
StephenHulme May 20, 2026
f9c3904
Update @vitest/coverage-v8 to version 4.1.6
depfu[bot] May 20, 2026
b8c3bfe
Update @vitejs/plugin-legacy to version 8.0.2
depfu[bot] May 20, 2026
65c3ba5
Merge pull request #5767 from sanger/depfu/update/knapsack_pro-10.0.0
StephenHulme May 20, 2026
01da7b7
Merge pull request #5768 from sanger/depfu/update/yarn/postcss-8.5.14
StephenHulme May 20, 2026
23e4c6b
Update rubocop to version 1.86.2
depfu[bot] May 20, 2026
0b2bf7b
Update ruboclean to version 0.8.0
depfu[bot] May 20, 2026
55f4b43
style: disable Style/RedundantSelf
StephenHulme May 20, 2026
a253ac6
Merge pull request #5795 from sanger/depfu/update/ruboclean-0.8.0
StephenHulme May 20, 2026
6cb333d
Merge branch 'develop' into depfu/update/rubocop-1.86.2
StephenHulme May 20, 2026
e80a349
Merge pull request #5794 from sanger/depfu/update/rubocop-1.86.2
StephenHulme May 20, 2026
36fa148
Merge pull request #5792 from sanger/depfu/update/yarn/@vitejs/plugin…
StephenHulme May 20, 2026
6dc9829
Merge pull request #5791 from sanger/depfu/update/yarn/@vitest/covera…
StephenHulme May 20, 2026
ae29c47
Update concurrent-ruby to version 1.3.6
depfu[bot] May 20, 2026
f9fc9cd
build: remove constraint on concurrent-ruby
StephenHulme May 20, 2026
fc0556c
Merge pull request #5798 from sanger/depfu/update/concurrent-ruby-1.3.6
StephenHulme May 21, 2026
75d94ee
Update flipper to version 1.4.2
depfu[bot] May 21, 2026
de5fdd8
Merge pull request #5804 from sanger/depfu/update/flipper-1.4.2
StephenHulme May 21, 2026
9662ea1
Update flipper-active_record to version 1.4.2
depfu[bot] May 21, 2026
f28da50
Merge pull request #5802 from sanger/depfu/update/flipper-active_reco…
StephenHulme May 21, 2026
d324c33
Update flipper-ui to version 1.4.2
depfu[bot] May 21, 2026
3453b16
Merge pull request #5805 from sanger/depfu/update/flipper-ui-1.4.2
StephenHulme May 21, 2026
ac9c464
Merge branch 'develop' into Y26-058-qc-report-download
StephenHulme May 21, 2026
523cc0a
Merge pull request #5763 from sanger/Y26-058-qc-report-download
StephenHulme May 21, 2026
315fb53
Update selenium-webdriver to version 4.44.0
depfu[bot] May 21, 2026
55b1fce
Update terser to version 5.47.1
depfu[bot] May 21, 2026
dd1e7f9
Merge pull request #5807 from sanger/depfu/update/selenium-webdriver-…
StephenHulme May 22, 2026
8666389
Merge pull request #5808 from sanger/depfu/update/yarn/terser-5.47.1
StephenHulme May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ Style/QuotedSymbols:
Exclude:
- bin/*

# Keep consistency across attribute writers and readers
Style/RedundantSelf:
Enabled: false

# Files generated by Rails
Style/StringLiterals:
Exclude:
Expand Down
14 changes: 6 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --no-exclude-limit`
# on 2026-04-22 15:46:09 UTC using RuboCop version 1.86.1.
# on 2026-05-05 14:43:06 UTC using RuboCop version 1.86.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -301,12 +301,11 @@ Lint/UselessOr:
- 'app/models/qcable/statemachine.rb'
- 'app/models/ui_helper/summary.rb'

# Offense count: 11
# Offense count: 7
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Exclude:
- 'app/controllers/api/v2/transfers_controller.rb'
- 'app/controllers/studies/information_controller.rb'
- 'app/jobs/export_pool_xp_to_traction_job.rb'
- 'app/models/accession_service/base_service.rb'
- 'app/sample_manifest_excel/sample_manifest_excel/manifest_type_list.rb'
Expand Down Expand Up @@ -334,7 +333,7 @@ Metrics/CyclomaticComplexity:
- 'app/models/accession_service/base_service.rb'
- 'lib/limber/helper.rb'

# Offense count: 19
# Offense count: 18
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Exclude:
Expand Down Expand Up @@ -617,7 +616,7 @@ RSpec/BeforeAfterAll:
- 'spec/sample_manifest_excel/worksheet_spec.rb'
- 'spec/sequencescape_excel/worksheet_spec.rb'

# Offense count: 342
# Offense count: 330
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand Down Expand Up @@ -649,7 +648,6 @@ RSpec/ContextWording:
- 'spec/models/barcode_spec.rb'
- 'spec/models/broadcast_event/lab_event_spec.rb'
- 'spec/models/broadcast_event/qc_assay_spec.rb'
- 'spec/models/bulk_submission_spec.rb'
- 'spec/models/comment_spec.rb'
- 'spec/models/illumina_htp/initial_stock_tube_purpose_spec.rb'
- 'spec/models/location_report_form_spec.rb'
Expand Down Expand Up @@ -840,7 +838,7 @@ RSpec/ExampleWording:
- 'spec/sequencescape_excel/validation_spec.rb'
- 'spec/sequencescape_excel/worksheet_spec.rb'

# Offense count: 27
# Offense count: 26
RSpec/ExpectInHook:
Exclude:
- 'spec/controllers/labwhere_receptions_controller_spec.rb'
Expand Down Expand Up @@ -1197,7 +1195,7 @@ RSpec/MultipleExpectations:
- 'spec/views/labware/show_chromium_chip_spec.rb'
- 'spec/views/samples/index_html_erb_spec.rb'

# Offense count: 243
# Offense count: 249
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Expand Down
8 changes: 2 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source 'https://rubygems.org'

group :default do
gem 'bootsnap'
gem 'concurrent-ruby', '1.3.5'
gem 'concurrent-ruby'
gem 'configatron'
gem 'formtastic'
gem 'rails', '~> 8.0.0'
Expand All @@ -21,10 +21,6 @@ group :default do
gem 'faraday-multipart'
gem 'rest-client' # Deprecated, but still used in some places, replace with Faraday where possible

# Fix incompatibility with between Ruby 3.1 and Psych 4 (used for yaml)
# see https://stackoverflow.com/a/71192990
gem 'psych', '< 4'

# State machine
gem 'aasm'
gem 'after_commit_everywhere', '~> 1.0' # Required by AASM
Expand All @@ -34,7 +30,7 @@ group :default do

# Provides bulk insert capabilities
gem 'activerecord-import'
gem 'record_loader', git: 'https://github.com/sanger/record_loader', tag: 'v0.3.0'
gem 'record_loader', git: 'https://github.com/sanger/record_loader', tag: 'v1.1.0'

gem 'mysql2', platforms: :mri
gem 'will_paginate'
Expand Down
45 changes: 24 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ GIT

GIT
remote: https://github.com/sanger/record_loader
revision: 238db7fa24fffee5ad413bd9cd4c6b857d1626c9
tag: v0.3.0
revision: 9e7f1b67c3eeee1895f1befc6a54682f11c02135
tag: v1.1.0
specs:
record_loader (0.3.0)
record_loader (1.1.0)
psych (~> 5.0)

GIT
remote: https://github.com/sanger/sanger_barcode_format.git
Expand Down Expand Up @@ -170,7 +171,7 @@ GEM
choice (0.2.0)
chronic (0.10.2)
coderay (1.1.3)
concurrent-ruby (1.3.5)
concurrent-ruby (1.3.6)
configatron (4.5.1)
connection_pool (2.5.5)
crack (1.0.1)
Expand Down Expand Up @@ -233,7 +234,7 @@ GEM
factory_bot_rails (6.5.1)
factory_bot (~> 6.5)
railties (>= 6.1.0)
faraday (2.14.1)
faraday (2.14.2)
faraday-net_http (>= 2.0, < 3.5)
json
logger
Expand All @@ -244,14 +245,14 @@ GEM
ffi (1.17.3-arm64-darwin)
ffi (1.17.3-x86_64-darwin)
ffi (1.17.3-x86_64-linux-gnu)
flipper (1.4.1)
flipper (1.4.2)
concurrent-ruby (< 2)
flipper-active_record (1.4.1)
flipper-active_record (1.4.2)
activerecord (>= 4.2, < 9)
flipper (~> 1.4.1)
flipper-ui (1.4.1)
flipper (~> 1.4.2)
flipper-ui (1.4.2)
erubi (>= 1.0.0, < 2.0.0)
flipper (~> 1.4.1)
flipper (~> 1.4.2)
rack (>= 1.4, < 4)
rack-protection (>= 1.5.3, < 5.0.0)
rack-session (>= 1.0.2, < 3.0.0)
Expand Down Expand Up @@ -280,16 +281,16 @@ GEM
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.19.4)
json (2.19.5)
jsonapi-resources (0.9.0)
activerecord (>= 4.1)
concurrent-ruby
railties (>= 4.1)
jsonapi-resources-matchers (1.0.0)
jsonapi-resources (>= 0.9.0)
knapsack_pro (9.2.3)
logger
knapsack_pro (10.0.0)
rake
thor (~> 1.4)
language_server-protocol (3.17.0.5)
launchy (3.1.1)
addressable (~> 2.8)
Expand Down Expand Up @@ -378,7 +379,9 @@ GEM
pry (>= 0.13, < 0.17)
pry-rails (0.3.11)
pry (>= 0.13.0)
psych (3.3.4)
psych (5.3.1)
date
stringio
public_suffix (7.0.5)
puma (7.2.0)
nio4r (~> 2.0)
Expand Down Expand Up @@ -499,8 +502,8 @@ GEM
rspec-mocks (>= 3.13.0, < 5.0.0)
rspec-support (>= 3.13.0, < 5.0.0)
rspec-support (3.13.7)
ruboclean (0.7.1)
rubocop (1.86.1)
ruboclean (0.8.0)
rubocop (1.86.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
Expand Down Expand Up @@ -552,7 +555,7 @@ GEM
ffi (~> 1.12)
logger
ruby2_keywords (0.0.5)
rubyzip (3.2.2)
rubyzip (3.3.0)
sanger-jsonapi-resources (0.1.2)
activerecord (>= 4.1)
concurrent-ruby
Expand All @@ -562,7 +565,7 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.16.8)
securerandom (0.4.1)
selenium-webdriver (4.43.0)
selenium-webdriver (4.44.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand All @@ -589,6 +592,7 @@ GEM
rbtree
set (~> 1.0)
ssrf_filter (1.2.0)
stringio (3.2.0)
syntax_tree (6.3.0)
prettier_print (>= 1.2.0)
syntax_tree-haml (4.0.3)
Expand Down Expand Up @@ -622,7 +626,7 @@ GEM
uri (1.1.1)
useragent (0.16.11)
uuidtools (3.0.0)
vite_rails (3.10.0)
vite_rails (3.11.0)
railties (>= 5.1, < 9)
vite_ruby (~> 3.0, >= 3.2.2)
vite_ruby (3.10.2)
Expand Down Expand Up @@ -680,7 +684,7 @@ DEPENDENCIES
capybara
carrierwave
caxlsx
concurrent-ruby (= 1.3.5)
concurrent-ruby
configatron
csv (~> 3.3)
cucumber-rails
Expand Down Expand Up @@ -716,7 +720,6 @@ DEPENDENCIES
prettier_print
pry-byebug
pry-rails
psych (< 4)
puma
rack-acceptable
rack-cors
Expand Down
11 changes: 10 additions & 1 deletion app/controllers/qc_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ def show # rubocop:todo Metrics/AbcSize
def create # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
study = Study.find_by(id: params[:qc_report][:study_id])
exclude_existing = params[:qc_report][:exclude_existing] == '1'
plate_barcodes = format_plate_barcodes(params[:qc_report][:plate_barcodes_text])
qc_report =
QcReport.new(
study: study,
product_criteria: @product.stock_criteria,
exclude_existing: exclude_existing,
plate_purposes: params[:qc_report][:plate_purposes].try(:reject, &:blank?)
plate_purposes: params[:qc_report][:plate_purposes].try(:reject, &:blank?),
plate_barcodes: plate_barcodes
)

if qc_report.save
Expand All @@ -64,6 +66,13 @@ def create # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
end
end

def format_plate_barcodes(plate_barcodes)
return nil if plate_barcodes.nil?

# Split the input string into an array of barcodes
plate_barcodes.split(/\s+/)
end

# On form submit of a qc_file. Strictly speaking this should be an update action
# on the qc_report itself. However we don't want to force the user to extract
# the report identifier from the file.
Expand Down
2 changes: 1 addition & 1 deletion app/models/broadcast_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BroadcastEvent < ApplicationRecord
# https://api.rubyonrails.org/classes/ActiveRecord/Inheritance/ClassMethods.html
validates :sti_type, presence: true

serialize :properties, coder: YAML
serialize :properties, coder: YAML, yaml: { permitted_classes: [ActionController::Parameters] }
self.inheritance_column = 'sti_type'

broadcast_with_warren
Expand Down
2 changes: 1 addition & 1 deletion app/models/presenters/qc_report_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def product_name
end

def study_name
qc_report.study.name
qc_report.study&.name || 'N/A'
end

def study_abbreviation
Expand Down
25 changes: 20 additions & 5 deletions app/models/qc_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ module ReportBehaviour
# You can trigger a synchronous report manually by calling #generate!
# rubocop:todo Metrics/MethodLength
def generate_report # rubocop:todo Metrics/AbcSize
study.each_well_for_qc_report_in_batches(
Well.qc_report_in_batches(
study,
exclude_existing,
product_criteria,
(plate_purposes.empty? ? nil : plate_purposes)
(plate_purposes.empty? ? nil : plate_purposes),
(plate_barcodes.empty? ? nil : plate_barcodes)
) do |assets|
# If there are some wells of interest, we get them in a list
connected_wells = Well.hash_stock_with_targets(assets, product_criteria.target_plate_purposes)
Expand Down Expand Up @@ -128,17 +130,30 @@ def generate_report # rubocop:todo Metrics/AbcSize
has_many :qc_metrics

serialize :plate_purposes, type: Array, coder: YAML
serialize :plate_barcodes, type: Array, coder: YAML

before_validation :generate_report_identifier, if: :identifier_required?

after_create :schedule_report

scope :for_report_page, ->(conditions) { order(id: :desc).where(conditions).joins(:product_criteria) }

validates :product_criteria, :study, :state, presence: true
validates :product_criteria, :state, presence: true

validates :exclude_existing, inclusion: { in: [true, false], message: 'should be true or false.' }

validate :check_valid_plate_barcodes, if: -> { plate_barcodes.present? }

# We allow null values for study_id to allow qc_reports to be created without a study (just plate_barcodes)
validates :study, presence: true, unless: -> { plate_barcodes.present? }

def check_valid_plate_barcodes
invalid_barcodes = plate_barcodes.reject { |barcode| Plate.find_by_barcode(barcode) }
return unless invalid_barcodes.any?

errors.add(:plate_barcodes, "contain invalid barcodes: #{invalid_barcodes.join(', ')}")
end

# Reports are handled asynchronously
def schedule_report
Delayed::Job.enqueue QcReportJob.new(id)
Expand Down Expand Up @@ -166,9 +181,9 @@ def identifier_required?
# same product / study abbreviation combo within one second
# of each other.
def generate_report_identifier
return true if study.nil? || product_criteria.nil?
return true if product_criteria.nil?

rid = [study.abbreviation, product_criteria.product.name, DateTime.now.to_fs(:number)].compact
rid = [study&.abbreviation, product_criteria.product.name, DateTime.now.to_fs(:number)].compact
.join('_')
.downcase
.gsub(/[^\w]/, '_')
Expand Down
9 changes: 8 additions & 1 deletion app/models/request_type/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ def valid_options

belongs_to :request_type, optional: false
validates :request_option, :valid_options, presence: true
serialize :valid_options, coder: YAML
serialize :valid_options, coder: YAML, yaml: {
permitted_classes: [
Range,
RequestType::Validator::ArrayWithDefault,
RequestType::Validator::FlowcellTypeValidator,
RequestType::Validator::LibraryTypeValidator
]
}

delegate :include?, to: :valid_options

Expand Down
14 changes: 0 additions & 14 deletions app/models/study.rb
Original file line number Diff line number Diff line change
Expand Up @@ -446,20 +446,6 @@ def validate_ethically_approved
false
end

def each_well_for_qc_report_in_batches(exclude_existing, product_criteria, plate_purposes = nil)
# @note We include aliquots here, despite the fact they are only needed if we have to set a poor-quality flag
# as in some cases failures are not as rare as you may imagine, and it can cause major performance issues.
base_scope =
Well
.on_plate_purpose_included(PlatePurpose.where(name: plate_purposes || STOCK_PLATE_PURPOSES))
.for_study_through_aliquot(self)
.without_blank_samples
.includes(:well_attribute, :aliquots, :map, samples: :sample_metadata)
.readonly(true)
scope = exclude_existing ? base_scope.without_report(product_criteria) : base_scope
scope.find_in_batches { |wells| yield wells }
end

def warnings
# These studies are now invalid, but the warning should remain until existing studies are fixed.
if study_metadata.managed? && study_metadata.data_access_group.blank?
Expand Down
Loading
Loading