Skip to content

Commit

Permalink
Merge pull request #448 from sanger/update-config-rake
Browse files Browse the repository at this point in the history
In config.rake, update `find_each` usages to `each`
  • Loading branch information
harrietc52 authored Sep 24, 2024
2 parents 8d3b460 + a72fa9f commit 5564502
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ GEM

PLATFORMS
arm64-darwin-22
arm64-darwin-23
x86_64-darwin-21
x86_64-linux

Expand Down
11 changes: 5 additions & 6 deletions lib/tasks/config.rake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ namespace :config do
CONFIG = {}.tap do |configuration|
configuration[:searches] = {}.tap do |searches|
puts 'Preparing searches ...'

api.search.find_each do |search|
api.search.each do |search|
searches[search.name] = search.uuid
end
end
Expand Down Expand Up @@ -55,15 +54,15 @@ namespace :config do
configuration[:transfer_templates] = {}.tap do |transfer_templates|
# Plates
puts 'Preparing transfer templates ...'
api.transfer_template.find_each do |template|
api.transfer_template.each do |template|
next unless ['Whole plate to tube', 'Transfer columns 1-12', 'Flip Plate', 'Transfer between specific tubes'].include?(template.name)
transfer_templates[template.name] = template.uuid
end
end

configuration[:lot_types] = {}.tap do |lot_types|
puts 'Preparing lot types ...'
api.lot_type.find_each do |lot_type|
api.lot_type.each do |lot_type|
lot_types[lot_type.name] = { uuid: lot_type.uuid, template_class: lot_type.template_class, printer_type: lot_type.printer_type, qcable_name: lot_type.qcable_name }
end
end
Expand All @@ -72,7 +71,7 @@ namespace :config do
puts 'Preparing purposes ...'
puts '... plates'
raise 'No default purpose configuration specified.' if Gatekeeper::Application.config.default_purpose_handler.nil?
api.plate_purpose.find_each do |plate_purpose|
api.plate_purpose.each do |plate_purpose|
# Loads the default purpose info
if Gatekeeper::Application.config.default_purpose_handler[:child_name] == plate_purpose.name
configuration[:default_purpose] = Gatekeeper::Application.config.default_purpose_handler.merge(
Expand All @@ -88,7 +87,7 @@ namespace :config do
}.merge(Gatekeeper::Application.config.purpose_handlers[plate_purpose.name] || {})
end
puts '... tubes'
api.tube_purpose.find_each do |tube_purpose|
api.tube_purpose.each do |tube_purpose|
next unless Gatekeeper::Application.config.tracked_purposes.include?(tube_purpose.name)
purpose[tube_purpose.uuid] = {
name: tube_purpose.name,
Expand Down

0 comments on commit 5564502

Please sign in to comment.