Class: AssetsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AssetsController
- Defined in:
- app/controllers/assets_controller.rb
Overview
Labware and Receptacle used to both be grouped under Asset and this controller handled them. Now the majority of the behaviour has moved off into the respective controllers. This remains to handle a few legacy endpoints:
show: Kept in place for CGP who were supposed to migrate off, but as of 23/12/2020 I'm (JG) still seeing activity. It might be we have another user who hasn't migrated. Currently it just mimics the receptacle show behaviour for xml requests. We also have a disambiguation page to handle links in from NPG, until they update to use the receptacles endpoint. Again, we're still getting activity here, so it looks like that hasn't happened yet. print_labels: This is used by the PhiX tubes created in the PhiX::SpikedBuffersController and PhiX::StocksController. It doesn't belong here. lookup: I can't find any links to this page, and it doesn't appear to have been used recently. However our logs don't go back all that far. Provides a page for scanning in barcodes. It appears to be supposed to redirect to the labware page, but it blows up for tubes and shows the qc information for plates.
Constant Summary
Constants included from FlashTruncation
FlashTruncation::STRING_OVERHEAD
Instance Method Summary collapse
-
#lookup ⇒ Object
JG 23/12/2020: I can't find any links to this page, and think we can probably lose it.
-
#print_labels ⇒ Object
TODO: This is currently used from the PhiX::SpikedBuffersController and PhiX::StocksController show pages.
-
#show ⇒ Object
rubocop:todo Metrics/PerceivedComplexity, Metrics/AbcSize.
Methods inherited from ApplicationController
#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!
Methods included from AuthenticatedSystem
Methods included from FlashTruncation
#max_flash_size, #truncate_flash, #truncate_flash_array
Instance Method Details
#lookup ⇒ Object
JG 23/12/2020: I can't find any links to this page, and think we can probably lose it.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'app/controllers/assets_controller.rb', line 62 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |
#print_labels ⇒ Object
TODO: This is currently used from the PhiX::SpikedBuffersController and PhiX::StocksController show pages. It doesn't really belong here.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/controllers/assets_controller.rb', line 49 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |
#show ⇒ Object
rubocop:todo Metrics/PerceivedComplexity, Metrics/AbcSize
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/assets_controller.rb', line 20 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |