Class: ActiveRecord::Associations::HasAndBelongsToManyAssociation
- Inherits:
-
AssociationCollection
- Object
- AssociationProxy
- AssociationCollection
- ActiveRecord::Associations::HasAndBelongsToManyAssociation
- Defined in:
- lib/gems/activerecord-2.2.2/lib/active_record/associations/has_and_belongs_to_many_association.rb
Overview
:nodoc:
Instance Method Summary collapse
Methods inherited from AssociationCollection
#<<, #any?, #build, #clear, #count, #delete, #delete_all, #destroy_all, #empty?, #find, #first, #include?, #initialize, #last, #length, #proxy_respond_to?, #replace, #reset, #size, #sum, #to_ary, #transaction, #uniq
Methods inherited from AssociationProxy
#===, #aliased_table_name, #conditions, #initialize, #inspect, #loaded, #loaded?, #proxy_owner, #proxy_reflection, #proxy_respond_to?, #proxy_target, #reload, #reset, #respond_to?, #send, #target, #target=
Constructor Details
This class inherits a constructor from ActiveRecord::Associations::AssociationCollection
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveRecord::Associations::AssociationCollection
Instance Method Details
#create(attributes = {}) ⇒ Object
4 5 6 |
# File 'lib/gems/activerecord-2.2.2/lib/active_record/associations/has_and_belongs_to_many_association.rb', line 4 def create(attributes = {}) create_record(attributes) { |record| insert_record(record) } end |
#create!(attributes = {}) ⇒ Object
8 9 10 |
# File 'lib/gems/activerecord-2.2.2/lib/active_record/associations/has_and_belongs_to_many_association.rb', line 8 def create!(attributes = {}) create_record(attributes) { |record| insert_record(record, true) } end |