diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb index b3c87fbc5..b9a51f986 100644 --- a/app/controllers/exports_controller.rb +++ b/app/controllers/exports_controller.rb @@ -62,7 +62,7 @@ def set_filename def ancestor_tube_details(ancestor_results) ancestor_results.each_with_object({}) do |ancestor_result, tube_list| - tube = Sequencescape::Api::V2::Tube.find_by(uuid: ancestor_result.uuid) + tube = Sequencescape::Api::V2::Tube.find_by({uuid: ancestor_result.uuid}) tube_sample_uuid = tube.aliquots.first.sample.uuid tube_list[tube_sample_uuid] = tube if tube_sample_uuid.present? end diff --git a/app/models/labware_creators/multi_stamp_tubes.rb b/app/models/labware_creators/multi_stamp_tubes.rb index 66e49e3ff..8f60516c1 100644 --- a/app/models/labware_creators/multi_stamp_tubes.rb +++ b/app/models/labware_creators/multi_stamp_tubes.rb @@ -101,7 +101,7 @@ def source_tube_outer_request_uuid(tube) end def request_hash(transfer, child_plate) - tube = Sequencescape::Api::V2::Tube.find_by(uuid: transfer[:source_tube]) + tube = Sequencescape::Api::V2::Tube.find_by({uuid: transfer[:source_tube]}) { 'source_asset' => transfer[:source_asset], diff --git a/app/models/labware_creators/plate_split_to_tube_racks.rb b/app/models/labware_creators/plate_split_to_tube_racks.rb index f10433435..b551b3e30 100644 --- a/app/models/labware_creators/plate_split_to_tube_racks.rb +++ b/app/models/labware_creators/plate_split_to_tube_racks.rb @@ -190,7 +190,7 @@ def tube_barcodes_are_unique? def check_tube_rack_scan_file(tube_rack_file, msg_prefix) tube_rack_file.position_details.each do |tube_posn, tube_details| foreign_barcode = tube_details['tube_barcode'] - tube_in_db = Sequencescape::Api::V2::Tube.find_by(barcode: foreign_barcode) + tube_in_db = Sequencescape::Api::V2::Tube.find_by({barcode: foreign_barcode}) next if tube_in_db.blank? msg = "#{msg_prefix} tube barcode #{foreign_barcode} (at rack position #{tube_posn}) already exists in the LIMS" @@ -224,7 +224,7 @@ def locate_ancestor_tubes return {} if ancestor_results.blank? ancestor_results.each_with_object({}) do |ancestor_result, tube_list| - tube = Sequencescape::Api::V2::Tube.find_by(uuid: ancestor_result.uuid) + tube = Sequencescape::Api::V2::Tube.find_by({uuid: ancestor_result.uuid}) tube_sample_uuid = tube.aliquots.first.sample.uuid tube_list[tube_sample_uuid] = tube if tube_sample_uuid.present? end diff --git a/app/models/labware_creators/pooled_tubes_by_sample.rb b/app/models/labware_creators/pooled_tubes_by_sample.rb index b4da80aa4..1d34547fc 100644 --- a/app/models/labware_creators/pooled_tubes_by_sample.rb +++ b/app/models/labware_creators/pooled_tubes_by_sample.rb @@ -192,7 +192,7 @@ def locate_ancestor_tubes return {} if ancestor_results.blank? ancestor_results.each_with_object({}) do |ancestor_result, tube_list| - tube = Sequencescape::Api::V2::Tube.find_by(uuid: ancestor_result.uuid) + tube = Sequencescape::Api::V2::Tube.find_by({uuid: ancestor_result.uuid}) tube_sample_uuid = tube.aliquots.first.sample.uuid tube_list[tube_sample_uuid] = tube if tube_sample_uuid.present? end diff --git a/app/models/labware_creators/pooled_tubes_by_submission_with_phi_x.rb b/app/models/labware_creators/pooled_tubes_by_submission_with_phi_x.rb index a78cdd015..f0d6103f0 100644 --- a/app/models/labware_creators/pooled_tubes_by_submission_with_phi_x.rb +++ b/app/models/labware_creators/pooled_tubes_by_submission_with_phi_x.rb @@ -43,7 +43,8 @@ def tube_must_be_spiked_buffer # Only call this method if the spikedbuffer_tube_barcode is present def scanned_tube - @scanned_tube ||= Sequencescape::Api::V2::Tube.find_by(barcode: spikedbuffer_tube_barcode) + search_params = { barcode: spikedbuffer_tube_barcode } + @scanned_tube ||= Sequencescape::Api::V2::Tube.find_by(search_params) end end end diff --git a/app/sequencescape/sequencescape/api/v2/sample.rb b/app/sequencescape/sequencescape/api/v2/sample.rb index 0831129f0..28673a119 100644 --- a/app/sequencescape/sequencescape/api/v2/sample.rb +++ b/app/sequencescape/sequencescape/api/v2/sample.rb @@ -10,7 +10,7 @@ class Sequencescape::Api::V2::Sample < Sequencescape::Api::V2::Base DEFAULT_INCLUDES = [].freeze def self.find_by(options, includes: DEFAULT_INCLUDES) - Sequencescape::Api::V2::Sample.includes(*includes).find(options).first + Sequencescape::Api::V2::Sample.includes(*includes).find(**options).first end def species diff --git a/app/sequencescape/sequencescape/api/v2/sample_metadata.rb b/app/sequencescape/sequencescape/api/v2/sample_metadata.rb index 0fd702e86..ef8746996 100644 --- a/app/sequencescape/sequencescape/api/v2/sample_metadata.rb +++ b/app/sequencescape/sequencescape/api/v2/sample_metadata.rb @@ -7,6 +7,6 @@ class Sequencescape::Api::V2::SampleMetadata < Sequencescape::Api::V2::Base DEFAULT_INCLUDES = [].freeze def self.find_by(options, includes: DEFAULT_INCLUDES) - Sequencescape::Api::V2::SampleMetadata.includes(*includes).find(options).first + Sequencescape::Api::V2::SampleMetadata.includes(*includes).find(**options).first end end diff --git a/app/sequencescape/sequencescape/api/v2/tube.rb b/app/sequencescape/sequencescape/api/v2/tube.rb index 3177e56ee..5c641a014 100644 --- a/app/sequencescape/sequencescape/api/v2/tube.rb +++ b/app/sequencescape/sequencescape/api/v2/tube.rb @@ -27,11 +27,11 @@ class Sequencescape::Api::V2::Tube < Sequencescape::Api::V2::Base property :updated_at, type: :time def self.find_by(options, includes: DEFAULT_INCLUDES) - Sequencescape::Api::V2::Tube.includes(*includes).find(options).first + Sequencescape::Api::V2::Tube.includes(*includes).find(**options).first end def self.find_all(options, includes: DEFAULT_INCLUDES, paginate: {}) - Sequencescape::Api::V2::Tube.includes(*includes).where(options).paginate(paginate).all + Sequencescape::Api::V2::Tube.includes(*includes).where(**options).paginate(paginate).all end # Dummied out for the moment. But no real reason not to add it to the API.