Class: ActiveFedora::Filter::Association
- Inherits:
-
Associations::CollectionAssociation
- Object
- Associations::CollectionAssociation
- ActiveFedora::Filter::Association
- Defined in:
- lib/active_fedora/filter/association.rb
Instance Method Summary collapse
- #concat(records) ⇒ Object
- #count_records ⇒ Object
- #delete(records) ⇒ Object
- #ids_reader ⇒ Object
- #writer(records) ⇒ Object
Instance Method Details
#concat(records) ⇒ Object
19 20 21 22 |
# File 'lib/active_fedora/filter/association.rb', line 19 def concat(records) records.flatten.each { |r| validate_assertion!(r) } extending_from.concat(records) end |
#count_records ⇒ Object
29 30 31 |
# File 'lib/active_fedora/filter/association.rb', line 29 def count_records ids_reader.length end |
#delete(records) ⇒ Object
13 14 15 |
# File 'lib/active_fedora/filter/association.rb', line 13 def delete(records) extending_from.delete(records) end |
#ids_reader ⇒ Object
24 25 26 27 |
# File 'lib/active_fedora/filter/association.rb', line 24 def ids_reader load_target super end |
#writer(records) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/active_fedora/filter/association.rb', line 5 def writer(records) records.each { |r| validate_assertion!(r) } existing_matching_records.each do |r| extending_from.delete(r) end extending_from.concat(records) end |