diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-17 23:20:21 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-17 23:20:21 -0500 |
commit | e66c0fc04967a122cfec656e5473a57ab0223183 (patch) | |
tree | fb11a60e6d757521d74517293c8f9cf441bf948f | |
parent | 3c91c8127050c7abbe091c19052f9813a62b1af7 (diff) | |
download | rails-e66c0fc04967a122cfec656e5473a57ab0223183.tar.gz rails-e66c0fc04967a122cfec656e5473a57ab0223183.tar.bz2 rails-e66c0fc04967a122cfec656e5473a57ab0223183.zip |
add CollectionAssociation hierarchy
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 3e29edfe64..c4ac2c9f77 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -4,7 +4,12 @@ module ActiveRecord # # CollectionAssociation is an abstract class that provides common stuff to # ease the implementation of association proxies that represent - # collections. See the class hierarchy in AssociationProxy. + # collections. See the class hierarchy in AssociationProxy + # + # CollectionAssociation: + # HasAndBelongsToManyAssociation => has_and_belongs_to_many + # HasManyAssociation => has_many + # HasManyThroughAssociation + ThroughAssociation => has_many :through # # You need to be careful with assumptions regarding the target: The proxy # does not fetch records from the database until it needs them, but new @@ -352,7 +357,7 @@ module ActiveRecord # an ActiveRecord::AssociationTypeMismatch error: # # person.pets.replace(["doo", "ggie", "gaga"]) - # #=> ActiveRecord::AssociationTypeMismatch: Pet expected, got String + # # => ActiveRecord::AssociationTypeMismatch: Pet expected, got String def replace(other_array) other_array.each { |val| raise_on_type_mismatch(val) } original_target = load_target.dup |