Class: CherrypickRequest

Inherits:
CustomerRequest show all
Defined in:
app/models/cherrypick_request.rb

Overview

This class is due to replace CherrypickForPulldownRequest A cherrypick represents a request to transfer material from one plate to another, usually for the purposes of consolidation for library creation.

Constant Summary

Constants included from Metadata

Metadata::SECTION_FIELDS

Constants included from Request::Statemachine

Request::Statemachine::ACTIVE, Request::Statemachine::COMPLETED_STATE, Request::Statemachine::INACTIVE, Request::Statemachine::OPENED_STATE, Request::Statemachine::SORT_ORDER

Constants included from StandardNamedScopes

StandardNamedScopes::SORT_FIELDS, StandardNamedScopes::SORT_ORDERS

Instance Method Summary collapse

Methods inherited from CustomerRequest

#customer_accepts_responsibility!, #generate_create_request_event, #generate_destroy_request_event, #generate_request_event, #update_responsibilities!

Methods inherited from Request

accessioning_required?, #add_comment, #aliquot_attributes, #associated_studies, #cancelable?, #copy, #current_request_event, #customer_accepts_responsibility!, delegate_validator, #detect_descriptor, #eventful_studies, for_study, #format_qc_information, get_all_comments, #has_passed, #lab_events_for_batch, #manifest_processed!, #most_recent_event_named, #next_request_type_id, #next_requests, #next_requests_via_asset, #next_requests_via_submission, number_expected_for_submission_id_and_request_type_id, #previous_failed_requests?, #priority, #product_line, #project=, #project_id=, #ready?, #request_type_updatable?, #return_pending_to_inbox!, #run_events, #source_labware, #study=, #study_id=, #submission_plate_count, #submitted_at, #target_purpose, #target_tube, #update_pool_information, #update_priority, #update_responsibilities!

Methods included from Request::Statistics

#asset_statistics, #progress_statistics, #sample_statistics_new

Methods included from EventfulRecord

#has_many_events, #has_many_lab_events, #has_one_event_with_family

Methods included from Metadata

#has_metadata

Methods included from Request::CustomerResponsibility

included

Methods included from Batch::RequestBehaviour

included, #recycle_from_batch!, #return_for_inbox!, #with_batch_id

Methods included from Request::Statemachine

#cancellable?, #change_decision!, #closed?, #failed_downstream!, #failed_upstream!, #finished?, #on_blocked, #on_cancelled, #on_failed, #on_hold, #open?, #terminated?

Methods included from StandardNamedScopes

included

Methods included from Commentable

#after_comment_addition

Methods included from AASM::Extensions

#transition_to

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods included from Api::RequestIo::Extensions

included, #json_root

Methods included from Aliquot::DeprecatedBehaviours::Request

#tag, #tag_number

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

extended

Instance Method Details

#on_passedObject



15
16
17
# File 'app/models/cherrypick_request.rb', line 15

def on_passed
  target_asset.transfer_requests_as_target.where(submission_id:).find_each(&:pass!)
end

#on_startedObject



9
10
11
12
13
# File 'app/models/cherrypick_request.rb', line 9

def on_started
  # Aliquots are transferred on creation by transfer requests.
  # This isn't ideal, but makes the transition easier without
  # slowing actual picks down.
end

#reduce_source_volumeObject



19
20
21
22
23
24
25
# File 'app/models/cherrypick_request.rb', line 19

def reduce_source_volume
  return unless asset.get_current_volume

  subtracted_volume = target_asset.get_picked_volume
  new_volume = asset.get_current_volume - subtracted_volume
  asset.set_current_volume(new_volume)
end