Class: ActiveFedora::Aggregation::ThroughAssociation

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/aggregation/through_association.rb

Instance Method Summary collapse

Constructor Details

#initialize(owner, reflection) ⇒ ThroughAssociation



3
4
5
# File 'lib/active_fedora/aggregation/through_association.rb', line 3

def initialize(owner, reflection)
  @owner, @reflection = owner, reflection
end

Instance Method Details

#ids_readerObject



21
22
23
# File 'lib/active_fedora/aggregation/through_association.rb', line 21

def ids_reader
  reader.target_ids
end

#ids_writer(vals) ⇒ Object



17
18
19
# File 'lib/active_fedora/aggregation/through_association.rb', line 17

def ids_writer(vals)
  reader.target_ids = vals
end

#readerObject

has_one :aggregation has_many :generic_files, through: :aggregation



9
10
11
# File 'lib/active_fedora/aggregation/through_association.rb', line 9

def reader
  @file_association ||= Association.new(@owner, @reflection)
end

#writer(vals) ⇒ Object



13
14
15
# File 'lib/active_fedora/aggregation/through_association.rb', line 13

def writer(vals)
  reader.target = vals
end