Permalink
Browse files

Update AR has_one association example

  • Loading branch information...
1 parent 8d7c38b commit 0e07a80f5ab4b1dda1f4a6e373a4ef0b6a933c29 @avakhov avakhov committed May 16, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations.rb
@@ -543,7 +543,7 @@ def association_instance_set(name, association)
# end
#
# @group = Group.first
- # @group.users.collect { |u| u.avatar }.flatten # select all avatars for all users in the group
+ # @group.users.collect { |u| u.avatar }.compact # select all avatars for all users in the group
# @group.avatars # selects all avatars by going through the User join model.
#
# An important caveat with going through +has_one+ or +has_many+ associations on the

0 comments on commit 0e07a80

Please sign in to comment.