Class: ActiveFedora::Aggregation::ThroughAssociation
- Inherits:
-
Object
- Object
- ActiveFedora::Aggregation::ThroughAssociation
- Defined in:
- lib/active_fedora/aggregation/through_association.rb
Instance Method Summary collapse
- #ids_reader ⇒ Object
- #ids_writer(vals) ⇒ Object
-
#initialize(owner, reflection) ⇒ ThroughAssociation
constructor
A new instance of ThroughAssociation.
-
#reader ⇒ Object
has_one :aggregation has_many :generic_files, through: :aggregation.
- #writer(vals) ⇒ Object
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_reader ⇒ Object
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 |
#reader ⇒ Object
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 |