Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
AuthenticatedSystem, FlashTruncation
Defined in:
app/controllers/application_controller.rb

Overview

Filters added to this controller apply to all controllers in the application. Likewise, all the methods added will be available for all controllers.

Direct Known Subclasses

Admin::AbilitiesController, Admin::AccessioningToolsController, Admin::BaitLibraries::BaitLibrarySuppliersController, Admin::BaitLibraries::BaitLibraryTypesController, Admin::BaitLibrariesController, Admin::CustomTextsController, Admin::DelayedJobsController, Admin::FacultySponsorsController, Admin::PlatePurposesController, Admin::PrimerPanelsController, Admin::ProgramsController, Admin::ProjectsController, Admin::RobotPropertiesController, Admin::RobotsController, Admin::Roles::UsersController, Admin::RolesController, Admin::StudiesController, Admin::UsersController, AdminController, AdvancedSearchController, Api::V2::Bioscan::ExportPoolXpToTractionController, Api::V2::Heron::PlatesController, Api::V2::Heron::TubeRackStatusesController, Api::V2::Heron::TubeRacksController, AssetAuditsController, AssetsController, BarcodePrintersController, Batches::CommentsController, Batches::RequestsController, BatchesController, BioscanControlLocationsController, BulkSubmissionExcel::DownloadsController, BulkSubmissionsController, DocumentsController, DriverFilesController, ErrorsController, EventsController, GelsController, GetYourQcCompletedTubesHereController, HealthController, HomesController, LabSearchesController, Labware::CommentsController, LabwareController, LabwhereReceptionsController, LocationReportsController, MessengersController, NpgActions::AssetsController, OrdersController, ParentsController, PhiX::SpikedBuffersController, PhiX::StocksController, PhiXesController, PickListsController, PipelinesController, PlatePicksController, PlateSummariesController, PlateTemplatesController, PlatesController, PlatesFromTubesController, PoolingsController, ProjectsController, QcFilesController, QcReportsController, QuadStampController, Receptacles::CommentsController, ReceptaclesController, ReferenceGenomesController, ReportFailsController, Requests::CommentsController, RequestsController, RobotVerificationsController, SampleLogisticsController, SampleManifestUploadWithTagSequencesController, Samples::CommentsController, Samples::StudiesController, SamplesController, Sdb::BaseController, SearchesController, SequenomQcPlatesController, SessionsController, StockStampersController, Studies::AssetGroupsController, Studies::CommentsController, Studies::DocumentsController, Studies::EventsController, Studies::InformationController, Studies::SamplesController, StudiesController, StudyReportsController, SubmissionsController, TagGroupsController, TagLayoutTemplatesController, TagSetsController, TagSubstitutionsController, TaxaController, TubeRackStatusesController, TubeRackSummariesController, UatActionsController, UsersController, UuidsController, WorkflowsController

Constant Summary

Constants included from FlashTruncation

FlashTruncation::STRING_OVERHEAD

Instance Method Summary collapse

Methods included from AuthenticatedSystem

included

Methods included from FlashTruncation

#max_flash_size, #truncate_flash, #truncate_flash_array

Instance Method Details

#block_api_access(message = nil, format = :xml) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'app/controllers/application_controller.rb', line 29

 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

#evil_parameter_hack!Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'app/controllers/application_controller.rb', line 46

 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

#extract_header_infoObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/controllers/application_controller.rb', line 35

 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

#set_cache_disabled!Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'app/controllers/application_controller.rb', line 40

 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