Class: Determiner
Class Method Summary
collapse
Instance Method Summary
collapse
#set_project_if_possible
#has_polymorphic_relationship?
Class Method Details
.human_name ⇒ Object
29
30
31
|
# File 'app/models/determiner.rb', line 29
def self.human_name
'Determiner'
end
|
Instance Method Details
#dwc_occurrences ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/models/determiner.rb', line 11
def dwc_occurrences
co = DwcOccurrence
.joins("JOIN collection_objects co on dwc_occurrence_object_id = co.id AND dwc_occurrence_object_type = 'CollectionObject'")
.joins("JOIN taxon_determinations td on co.id = td.taxon_determination_object_id AND td.taxon_determination_object_type = 'CollectionObject'")
.joins("JOIN roles r on r.type = 'Determiner' AND r.role_object_type = 'TaxonDetermination' AND r.role_object_id = td.id")
.where(r: {id:})
.distinct
fo = DwcOccurrence
.joins("JOIN field_occurrences fo on dwc_occurrence_object_id = fo.id AND dwc_occurrence_object_type = 'FieldOccurrence'")
.joins("JOIN taxon_determinations td on fo.id = td.taxon_determination_object_id AND td.taxon_determination_object_type = 'FieldOccurrence'")
.joins("JOIN roles r on r.type = 'Determiner' AND r.role_object_type = 'TaxonDetermination' AND r.role_object_id = td.id")
.where(r: {id:})
.distinct
::Queries.union(DwcOccurrence, [co, fo])
end
|
#year_active_year ⇒ Object
33
34
35
|
# File 'app/models/determiner.rb', line 33
def year_active_year
role_object.year_made
end
|