Class: SourceAuthor

Inherits:
Role::SourceRole show all
Defined in:
app/models/source_author.rb

Overview

Namespaced at root for convenience sake (so we don’t have to reference it as Role::SourceRole::SourceAuthor)

Instance Attribute Summary

Attributes included from Housekeeping::Users

#by

Attributes inherited from Role

#organization_id, #person_id, #position, #project_id, #role_object_id, #role_object_type, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Housekeeping::Users

#set_created_by_id, #set_updated_by_id

Methods inherited from Role

#agent, #agent_is_legal, #agent_present, #agent_type, #cached_trigger_methods, #cached_triggers, #do_not_set_cached, #is_last_role?, #only_one_agent, #organization_allowed?, #set_cached, #set_role_object_cached

Methods included from Shared::IsData

#errors_excepting, #full_error_messages_excepting, #identical, #is_community?, #is_destroyable?, #is_editable?, #is_in_use?, #is_in_users_projects?, #metamorphosize, #similar

Methods included from Shared::PolymorphicAnnotator

#annotated_object_is_persisted?

Methods included from Housekeeping::Timestamps

#data_breakdown_for_chartkick_recent

Methods inherited from ApplicationRecord

transaction_with_retry

Class Method Details

.human_nameObject



4
5
6
# File 'app/models/source_author.rb', line 4

def self.human_name
  'Author'
end

Instance Method Details

#year_active_yearObject

Technically this can be wrong, when published post-humously, however, our definition of “active” is not locked in stone.



10
11
12
13
14
# File 'app/models/source_author.rb', line 10

def year_active_year
  y = role_object.year
  y ||= role_object.stated_year
  y
end