Class: AutomatedOrder

Inherits:
FlexibleSubmission show all
Defined in:
app/models/automated_order.rb

Overview

An automated order is created by an external application, such as Limber. Retrieval of studies/projects is surprisingly expensive, and isn't relevant for cross-project/study stuff anyway. Rather than COMPLETELY disabling validation of study/project presence, we use the current permissions for cross study/project-stuff, and auto populate the field elsewhere. If someone manages to somehow mix multiple assets in different single studies, we still throw validation errors

Constant Summary

Constants inherited from Order

Order::AssetTypeError, Order::DEFAULT_ASSET_INPUT_METHODS

Constants included from Submission::ProjectValidation

Submission::ProjectValidation::Error

Instance Attribute Summary

Attributes inherited from Order

#asset_input_methods, #customize_partial, #info_differential, #input_field_infos, #request_type_ids_list

Instance Method Summary collapse

Methods inherited from FlexibleSubmission

#request_type_ids, #request_type_ids=, #request_type_multiplier

Methods included from Submission::Crossable

#cross_compatible?, #cross_project_allowed, #cross_study_allowed

Methods included from Submission::FlexibleRequestGraph::OrderMethods

#build_request_graph!

Methods inherited from Order

#add_comment, #all_assets, #all_samples, #asset_uuids, #building?, #building_submission?, #collect_gigabases_expected?, #create_request_of_type!, #cross_compatible?, #cross_project_allowed, #cross_study_allowed, #duplicates_within, #first_request_type, #friendly_name, #generate_broadcast_event, #json_root, #multiplexed?, #multiplier_for, #next_request_type_id, #not_ready_samples, #on_delete_destroy_submission, render_class, #request_types_list, #samples, #sequencing_order?, #study_is_active, #subject_type

Methods included from Submission::AccessionBehaviour

#can_check_data_release_and_accession?, #check_data_release_and_accession_for_submission, included, #request_types_require_accessioning?

Methods included from Submission::RequestOptionsBehaviour

included, #request_options=

Methods included from Submission::ProjectValidation

#checking_project?, #complete_building, included, #save_after_unmarshalling, #submittable?, #validating?

Methods included from Submission::AssetGroupBehaviour

#complete_building, included

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods included from Order::InstanceMethods

#complete_building

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#set_project_from_aliqoutsObject


19
20
21
22
# File 'app/models/automated_order.rb', line 19

def set_project_from_aliqouts
  projects = assets.reduce(Set.new) { |set, asset| set.merge(asset.projects) }
  self.project = projects.first if projects.one?
end

#set_study_from_aliqoutsObject


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

def set_study_from_aliqouts
  studies = assets.reduce(Set.new) { |set, asset| set.merge(asset.studies) }
  self.study = studies.first if studies.one?
end