Class: ActiveFedora::Associations::HasAndBelongsToManyAssociation
- Inherits:
-
AssociationCollection
- Object
- AssociationProxy
- AssociationCollection
- ActiveFedora::Associations::HasAndBelongsToManyAssociation
- Defined in:
- lib/active_fedora/associations/has_and_belongs_to_many_association.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#columns ⇒ Object
def create!(attributes = {}) create_record(attributes) { |record| insert_record(record, true) } end.
- #find_target ⇒ Object
-
#initialize(owner, reflection) ⇒ HasAndBelongsToManyAssociation
constructor
A new instance of HasAndBelongsToManyAssociation.
Methods inherited from AssociationCollection
#<<, #add_record_to_target_with_callbacks, #build, #delete, #load_target, #replace, #reset, #size, #to_ary
Methods inherited from AssociationProxy
#loaded, #loaded?, #reload, #reset, #target, #target=
Constructor Details
#initialize(owner, reflection) ⇒ HasAndBelongsToManyAssociation
Returns a new instance of HasAndBelongsToManyAssociation.
5 6 7 |
# File 'lib/active_fedora/associations/has_and_belongs_to_many_association.rb', line 5 def initialize(owner, reflection) super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveFedora::Associations::AssociationProxy
Instance Method Details
#columns ⇒ Object
def create!(attributes = {})
create_record(attributes) { |record| insert_record(record, true) }
end
22 23 24 |
# File 'lib/active_fedora/associations/has_and_belongs_to_many_association.rb', line 22 def columns @reflection.columns(@reflection.[:join_table], "#{@reflection.[:join_table]} Columns") end |
#find_target ⇒ Object
9 10 11 |
# File 'lib/active_fedora/associations/has_and_belongs_to_many_association.rb', line 9 def find_target @owner.load_outbound_relationship(@reflection.name.to_s, @reflection.[:property]) end |