diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-17 15:05:39 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-17 15:05:50 -0500 |
commit | ea1477fb6d000073c340751c62c3d4d305e4d77f (patch) | |
tree | 8c3887a39ccc389568a00ae1fee0f87219efe65d | |
parent | a00bca625f70ee99d3fdfe65b5bf08d932d168a2 (diff) | |
download | rails-ea1477fb6d000073c340751c62c3d4d305e4d77f.tar.gz rails-ea1477fb6d000073c340751c62c3d4d305e4d77f.tar.bz2 rails-ea1477fb6d000073c340751c62c3d4d305e4d77f.zip |
fix CollectionAssociation#replace docs
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 90899b2078..19ca63d8b8 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -306,14 +306,14 @@ module ActiveRecord # end # # person.pets - # # => [ #<Pet name: "Snoop", type: "dog">, #<Pet name: "Wy", type: "cat"> ] + # # => [#<Pet id: 1, name: "Wy", group: "cats", person_id: 1>] # - # other_pets = [Pet.new(name: 'GorbyPuff', type: 'celibrity')] + # other_pets = [Pet.new(name: 'GorbyPuff', group: 'celebrities'] # # person.pets.replace(other_pets) # # person.pets - # # => [ #<Pet name: "GorbyPuff", type: "celebrity"> ] + # # => [#<Pet id: 2, name: "GorbyPuff", group: "celebrities", person_id: 1>] # # If the supplied array has an incorrect association type, it raises # an ActiveRecord::AssociationTypeMismatch error: |