Skip to content
Browse files

fix CollectionAssociation#replace docs

  • Loading branch information...
1 parent a00bca6 commit ea1477fb6d000073c340751c62c3d4d305e4d77f Francesco Rodriguez committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/associations/collection_association.rb
View
6 activerecord/lib/active_record/associations/collection_association.rb
@@ -306,14 +306,14 @@ def uniq(collection = load_target)
# 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:

0 comments on commit ea1477f

Please sign in to comment.
Something went wrong with that request. Please try again.