Module: Agents

Included in:
Accession, ArchivalObject, DigitalObject, DigitalObjectComponent, Event, Resource, RightsStatement
Defined in:
backend/app/model/mixins/agents.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'backend/app/model/mixins/agents.rb', line 6

def self.included(base)
  base.extend(ClassMethods)
  base.include(Relationships)

  base.define_relationship(:name => :linked_agents,
                           :json_property => 'linked_agents',
                           :contains_references_to_types => proc {AgentManager.registered_agents.map {|a| a[:model]}},
                           :class_callback => proc { |clz|
                             base.initialize_enum(clz)
                             base.initialize_terms(clz)
                           })
end