Class: Person

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Housekeeping::Users
Defined in:
app/models/person.rb

Direct Known Subclasses

Unvetted, Vetted

Defined Under Namespace

Classes: Unvetted, Vetted

Instance Method Summary collapse

Methods included from Housekeeping::Users

#alive?, #set_created_by_id, #set_updated_by_id

Instance Method Details

#is_author?Boolean



42
43
44
# File 'app/models/person.rb', line 42

def is_author?
  self.author_roles.to_a.length > 0
end

#is_collector?Boolean



54
55
56
# File 'app/models/person.rb', line 54

def is_collector?
  self.collector_roles.to_a.length > 0
end

#is_determiner?Boolean



58
59
60
# File 'app/models/person.rb', line 58

def is_determiner?
  self.determiner_roles.to_a.length > 0
end

#is_editor?Boolean



46
47
48
# File 'app/models/person.rb', line 46

def is_editor?
  self.editor_roles.to_a.length > 0
end

#is_source?Boolean



50
51
52
# File 'app/models/person.rb', line 50

def is_source?
  self.source_source_roles.to_a.length > 0
end

#is_taxon_name_author?Boolean



62
63
64
# File 'app/models/person.rb', line 62

def is_taxon_name_author?
  self.taxon_name_author_roles.to_a.length > 0
end

#is_type_designator?Boolean



66
67
68
# File 'app/models/person.rb', line 66

def is_type_designator?
  self.type_designator_roles.to_a.length > 0
end

#nameObject



38
39
40
# File 'app/models/person.rb', line 38

def name
  [self.first_name, self.prefix, self.last_name, self.suffix].compact.join(' ')
end