Top Level Namespace
Defined Under Namespace
Modules: AASM, Accession, AccessionHelper, AccessionService, Accessionable, ActsAsDescriptable, Api, ApiTools, ApplicationHelper, ArrayWithFieldList, AssetsHelper, Attributable, AuthenticatedSystem, AuthenticatedTestHelper, BarcodePrintersHelper, BatchesHelper, BootstrapHelper, BulkSubmissionExcel, CarrierWave, Cherrypick, CherrypickFormHelper, Commentable, CommentsProxy, CompoundSampleHelper, ControlRequestTypeCreation, ControllerHelper, Core, CronScripts, CsvParserClient, DataRelease, DelayedJobsHelper, DelegateValidation, Deployed, DescriptorJavascriptHelper, Dev, EBICheck, EncodingDetector, Endpoints, EventfulRecord, FieldInfosHelper, FlashTruncation, FontawesomeHelper, HTTPClients, HasBehaviour, Heron, HistoriesHelper, IncludeTag, Informatics, Insdc, Io, LabWhereClient, LabelPrinter, LinefeedFix, ManifestUtil, Metadata, MethodBenchmarking, NestedValidation, Parsers, PhiX, PipelinesHelper, PlatePicks, PlatesHelper, Presenters, ProductHelpers, PrototypeReplacementHelper, RecordLoader, ReportFailsHelper, RequestClassDeprecator, RequestTypePurposeCreation, RequestTypesHelper, RequestsHelper, RetentionInstructionHelper, SampleAccessioning, SampleManifestExcel, SamplesHelper, SearchBehaviour, SequencescapeExcel, SequencingQcBatch, SharedBehaviour, SingleReceptacleLabware, Squishify, StandardNamedScopes, StateChanger, StudiesHelper, SubmissionSerializer, SubmissionsHelper, Swipecardable, TagSubstitutionHelper, Tasks, UiHelper, UnderRepWellCommentsToBroadcast, UsersHelper, Validateable, ValidationStateGuard, ViewsSchema, VolumeCheck, WorkflowsHelper, WorkingSetup Classes: Ability, AbilityAnalysis, AddSpikedInControlTask, AdminController, AdvancedSearchController, Aliquot, AliquotIndex, AliquotIndexer, ApiApplication, ApiV2Generator, ApplicationController, ApplicationRecord, Asset, AssetAudit, AssetAuditsController, AssetBarcode, AssetCreation, AssetGroup, AssetGroupAsset, AssetLink, AssetShape, AssetsController, AssignTagsTask, AssignTagsToTubesTask, AssignTubesToMultiplexedWellsTask, AutomatedOrder, BaitLibrary, BaitLibraryLayout, BaitLibraryType, Barcode, BarcodePrefix, BarcodePrinter, BarcodePrinterType, BarcodePrinterType1DTube, BarcodePrinterType384DoublePlate, BarcodePrinterType384Plate, BarcodePrinterType96Plate, BarcodePrintersController, BaseLoginProxy, Batch, BatchCreationValidator, BatchRequest, BatchesController, BindingKitBarcodeTask, BioscanControlLocationsController, BroadcastEvent, BudgetDivision, BulkSubmission, BulkSubmissionsController, BulkTransfer, CherrypickForFluidigmRequest, CherrypickForPulldownPipeline, CherrypickForPulldownRequest, CherrypickPipeline, CherrypickRequest, CherrypickTask, CherrypickingPipeline, Comment, CompoundAliquot, Control, ControlPlate, ControlRequest, CreateAssetRequest, CustomMetadatum, CustomMetadatumCollection, CustomText, CustomerRequest, DataReleaseStudyType, DbFile, DeploymentEnvironment, Descriptor, DilutionPlate, DilutionPlatePurpose, Document, DocumentsController, DriverFilesController, ElementAvitiSequencingPipeline, ElementAvitiSequencingRequest, ElementAvitiValidator, Equipment, ErrorsController, Event, EventFactory, EventSender, EventfulMailer, EventsController, ExportPoolXpToTractionJob, ExtendedValidator, ExternalLibraryCreationRequest, ExternalProperty, ExternalReleaseEvent, ExtractionAttribute, FacultySponsor, Failure, FieldInfo, FlexibleCherrypickPipeline, FlexibleSubmission, FlowcellType, FlowcellTypesRequestType, FluidigmFile, FluidigmTemplateTask, Fragment, GelDilutionPlate, GelsController, GenerateCreateAssetRequestsJob, GenotypingPipeline, GenotypingRequest, GetYourQcCompletedTubesHereController, Health, HealthController, HiSeqSequencingRequest, HomesController, HttpLoginProxy, Identifier, IllegalOperation, Implement, Item, LabEvent, LabSearchesController, Labware, LabwareController, LabwhereReception, LabwhereReceptionsController, Lane, Latin1Validator, LegacyPipeline, LibPoolNormTubeGenerator, LibraryCreationRequest, LibraryEvent, LibraryTube, LibraryType, LibraryTypesRequestType, LinearSubmission, LocationReport, LocationReportJob, LocationReportsController, Lot, LotType, Map, MbraveTagsCreator, Messenger, MessengerCreator, MessengersController, MiSeqSequencingRequest, MovieLengthTask, MultiplexedCherrypickingTask, MultiplexedLibraryCreationRequest, MultiplexedLibraryTube, NovaSeq6000PESequencingRequest, NovaseqxPeValidator, NullCustomMetadatumCollection, ObjectSpaceProfile, OligoEnumerator, Order, OrderCompatibilityValidator, OrderRole, OrdersController, PacBioLibraryTube, PacBioSamplePrepPipeline, PacBioSamplePrepRequest, PacBioSequencingPipeline, PacBioSequencingRequest, ParentsController, PbmcPoolingCustomerRequest, Permission, PhiXesController, PickList, PickListJob, PickListsController, PicoAssayPlate, PicoDilutionPlate, Pipeline, PipelineRequestInformationType, PipelinesController, PipelinesRequestType, Plate, PlateBarcode, PlateConversion, PlateCreation, PlateMapGeneration, PlateOwner, PlatePicksController, PlatePurpose, PlateSummariesController, PlateTemplate, PlateTemplateTask, PlateTemplatesController, PlateTransferTask, PlateType, PlateVolume, PlatesController, PlatesFromTubesController, PolyMetadatum, PolymorphicUploader, PooledCherrypickRequest, PooledPlateCreation, Pooling, PoolingsController, PreCapturePool, PrepKitBarcodeTask, PrimerPanel, Product, ProductCatalogue, ProductCriteria, ProductLine, ProductProductCatalogue, Program, ProgramsValidator, Project, ProjectManager, ProjectsController, PsdFormatter, PulldownMultiplexedLibraryCreationRequest, PulldownMultiplexedLibraryTube, Purpose, QcAssay, QcDecision, QcFile, QcFilesController, QcMetric, QcMetricRequest, QcReport, QcReportJob, QcReportsController, QcRequest, QcResult, QcResultFactory, QcTube, Qcable, QcableCreator, QcableLibraryPlatePurpose, QcablePlatePurpose, QcableTubePurpose, QuadStampController, RackedTube, ReRequestSubmission, Receptacle, ReceptaclesController, ReferenceGenome, ReferenceGenomesController, ReportFail, ReportFailsController, Request, RequestEvent, RequestFactory, RequestInformation, RequestInformationType, RequestLogger, RequestType, RequestsController, Robot, RobotProperty, RobotVerificationsController, Role, Sample, SampleAccessioningJob, SampleCompoundComponent, SampleLogisticsController, SampleManifest, SampleManifestAsset, SampleManifestUploadWithTagSequencesController, SamplePrepQcTask, SampleTube, SamplesController, SangerSampleId, Search, SearchesController, SequencingPipeline, SequencingRequest, SequenomQcPlate, SequenomQcPlatesController, SessionsController, SetDescriptorsTask, SingleRequestSubmission, SpecificTubeCreation, SpecificTubeRackCreation, SpikedBuffer, Stamp, StateChange, StockLibraryTube, StockMultiplexedLibraryTube, StockStamper, StockStampersController, StripCreationRequest, StripTube, StudiesController, Study, StudyReport, StudyReportJob, StudyReportsController, StudySample, StudyType, Submission, SubmissionBuilderJob, SubmissionPool, SubmissionTemplate, SubmissionTemplateRequestType, SubmissionsController, SubmittedAsset, Supplier, SystemRequest, Tag, Tag2Layout, Tag2LayoutTemplate, TagGroup, TagGroupsController, TagGroupsTask, TagLayout, TagLayoutTemplate, TagLayoutTemplatesController, TagSet, TagSetsController, TagSubstitution, TagSubstitutionsController, Task, TaxaController, TestInformatics, Transfer, TransferRequest, TransferRequestCollection, TransferRequestCollectionTransferRequest, TransferTemplate, Tube, TubeCreation, TubeFromPlateCreation, TubeFromTubeCreation, TubeRack, TubeRackStatus, TubeRackStatusesController, TubeRackSummariesController, UatActionGenerator, UatActions, UatActionsController, UltimaGlobal, UltimaSequencingPipeline, UltimaSequencingRequest, UltimaValidator, User, UsersController, Utf8mb3Validator, Uuid, UuidsController, ValidateSampleSheetTask, VolumeUpdate, Well, WellAttribute, WorkCompletion, WorkCompletionsSubmission, WorkOrder, WorkOrderType, Workflow, WorkflowsController, WorkingDilutionPlate, XmlLoginProxy
Constant Summary collapse
- OrderTemplate =
SubmissionTemplate is really OrderTemplate, and the only place that actually cares is the API, so alias If we remove this, then we break our API endpoints. Some of which, at least at one point, actually had external users.
SubmissionTemplate
Instance Method Summary collapse
- #error_message_header(object) ⇒ Object
- #error_messages_ul_html_safe(object) ⇒ Object
-
#extract_barcode(args, attributes) ⇒ Object
mutates 'attributes'.
-
#handle_consent_withdrawal(cleaned_params, sample, user) ⇒ Object
If consent is being withdrawn and wasn't previously, set a couple of fields.
- #handle_page_update_failure(sample) ⇒ Object
- #handle_page_update_success(sample) ⇒ Object
-
#render_error_messages(object) ⇒ Object
error_messages_for method was deprecated, however lots of the tests depend on the message format it was using.
Instance Method Details
#error_message_header(object) ⇒ Object
391 392 393 394 395 396 397 |
# File 'app/helpers/application_helper.rb', line 391 def (object) count = object.errors..count model_name = object.class.to_s.tableize.tr('_', ' ').gsub(%r{/.*}, '').singularize is_plural = count > 1 ? 's' : '' header = "#{count} error#{is_plural} prohibited this #{model_name} from being saved" content_tag(:h2, header) end |
#error_messages_ul_html_safe(object) ⇒ Object
399 400 401 402 |
# File 'app/helpers/application_helper.rb', line 399 def (object) = object.errors..map { |msg| content_tag(:li, ERB::Util.html_escape(msg)) }.join.html_safe content_tag(:ul, ) end |
#extract_barcode(args, attributes) ⇒ Object
mutates 'attributes'
112 113 114 115 116 |
# File 'app/models/tube.rb', line 112 def (args, attributes) = args.first || attributes.delete(:barcode) prefix = attributes.delete(:barcode_prefix)&.prefix || default_prefix [, prefix] end |
#handle_consent_withdrawal(cleaned_params, sample, user) ⇒ Object
If consent is being withdrawn and wasn't previously, set a couple of fields
256 257 258 259 260 261 |
# File 'app/controllers/samples_controller.rb', line 256 def (cleaned_params, sample, user) return unless (cleaned_params[:sample_metadata_attributes][:consent_withdrawn] == 'true') && !sample. cleaned_params[:date_of_consent_withdrawn] = DateTime.now cleaned_params[:user_id_of_consent_withdrawn] = user.id end |
#handle_page_update_failure(sample) ⇒ Object
269 270 271 272 273 |
# File 'app/controllers/samples_controller.rb', line 269 def handle_page_update_failure(sample) flash[:error] = 'Failed to update attributes for sample' flash[:warning] = sample.errors. if sample.errors.present? redirect_to edit_sample_path(sample) end |
#handle_page_update_success(sample) ⇒ Object
263 264 265 266 267 |
# File 'app/controllers/samples_controller.rb', line 263 def handle_page_update_success(sample) flash[:notice] = 'Sample details have been updated' flash[:warning] = sample.errors. if sample.errors.present? redirect_to sample_path(sample) end |
#render_error_messages(object) ⇒ Object
error_messages_for method was deprecated, however lots of the tests depend on the message format it was using. apidock.com/rails/ActionView/Helpers/ActiveRecordHelper/error_messages_for
382 383 384 385 386 387 388 389 |
# File 'app/helpers/application_helper.rb', line 382 def (object) return if object.errors.count.zero? contents = +'' contents << (object) contents << (object) content_tag(:div, contents.html_safe) end |