Class: Dynamoid::Associations::HasAndBelongsToMany
- Inherits:
-
Object
- Object
- Dynamoid::Associations::HasAndBelongsToMany
- Includes:
- Association
- Defined in:
- lib/dynamoid/associations/has_and_belongs_to_many.rb
Instance Attribute Summary
Attributes included from Association
#name, #options, #query, #source
Instance Method Summary (collapse)
-
- (Boolean) ==(other)
Is this array equal to the association's records?.
-
- (Object) method_missing(method, *args)
Delegate methods we don't find directly to the records array.
Methods included from Association
#<<, #create, #create!, #delete, #delete_all, #destroy_all, #each, #include?, #initialize, #records, #setter, #where
Constructor Details
This class inherits a constructor from Dynamoid::Associations::Association
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(method, *args)
Delegate methods we don't find directly to the records array.
21 22 23 24 25 26 27 |
# File 'lib/dynamoid/associations/has_and_belongs_to_many.rb', line 21 def method_missing(method, *args) if records.respond_to?(method) records.send(method, *args) else super end end |
Instance Method Details
- (Boolean) ==(other)
Is this array equal to the association's records?
14 15 16 |
# File 'lib/dynamoid/associations/has_and_belongs_to_many.rb', line 14 def ==(other) records == Array(other) end |