Class: Project
Overview
rubocop:disable Metrics/ClassLength
Constant Summary
collapse
- ACTIVE_STATE =
'active'
- PROJECT_FUNDING_MODELS =
['', 'Internal', 'External', 'External - own machine'].freeze
Constants included
from Metadata
Metadata::SECTION_FIELDS
Class Method Summary
collapse
Instance Method Summary
collapse
has_many_events, has_many_lab_events, has_one_event_with_family
Methods included from Metadata
has_metadata
included
included, #unsaved_uuid!, #uuid
included
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
extended
#broadcast_except_externally_managed, included
Class Method Details
.states ⇒ Object
19
20
21
|
# File 'app/models/project.rb', line 19
def self.states
Project.aasm.states.map(&:name)
end
|
Instance Method Details
#actionable? ⇒ Boolean
95
96
97
|
# File 'app/models/project.rb', line 95
def actionable?
project_metadata.budget_division.name != 'Unallocated'
end
|
#manager ⇒ Object
91
92
93
|
# File 'app/models/project.rb', line 91
def manager
managers.first
end
|
#owner ⇒ Object
87
88
89
|
# File 'app/models/project.rb', line 87
def owner
owners.first
end
|
#r_and_d? ⇒ Boolean
106
107
108
|
# File 'app/models/project.rb', line 106
def r_and_d?
project_metadata.budget_division.name == configatron.r_and_d_division
end
|
#sequencing_budget_division ⇒ Object
110
111
112
|
# File 'app/models/project.rb', line 110
def sequencing_budget_division
project_metadata.budget_division.name
end
|
#subject_type ⇒ Object
145
146
147
|
# File 'app/models/project.rb', line 145
def subject_type
'project'
end
|
#submittable? ⇒ Boolean
99
100
101
102
103
104
|
# File 'app/models/project.rb', line 99
def submittable?
return true if project_metadata.project_funding_model.present?
errors.add(:base, 'No funding model specified')
false
end
|